Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8666495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:44:43+00:00 2026-06-12T17:44:43+00:00

Anybody know how to programmatically add an IP address to IPv4 and domain restrictions

  • 0

Anybody know how to programmatically add an IP address to “IPv4 and domain restrictions” in IIS7 using vb.net.

i.e I want to exclude some ips or range of IPs from accessing certain folders on my server and allow certain users to access it.

I found those nice articles :

http://www.iis.net/configreference/system.webserver/security/ipsecurity/add

https://serverfault.com/questions/305681/iis-7-address-restrictions-importing-list-to-block-china-and-korea-ips

http://www.tuicool.com/articles/uQru6v

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T17:44:45+00:00Added an answer on June 12, 2026 at 5:44 pm

    Maybe you can add the restrictions by executing some command line tool.

    (The following information is copy-pasted from Microsoft IIS documentation)
    Configure IPv4 Address and Domain Name Allow Rules (IIS 7) (Original document here)

    To create an allow rule for IPv4 address and domain restriction, use
    the following syntax:

    appcmd set config /section:ipsecurity /+"[ipaddress=' string ',allowed='true',subnetMask=' string ',domainName=' string ']"
    

    The variable ipaddress string is a single IPv4 address. The variable
    subnetMask string is a subnet mask. Use the subnet mask in combination
    with the IPv4 address to identify an address space that applies to
    this rule. The variable domain name string is a domain name. Typically
    you would use an IP address or a domain name, but not both in the same
    rule.

    For example, to create an allow rule for IPv4 address 10.0.0.1, type
    the following at the command prompt, and then press ENTER:

    appcmd set config /section:ipsecurity /+"[ipaddress='10.0.0.1',allowed='true']"
    

    For more information about Appcmd.exe, see Appcmd.exe (IIS 7).

    Update
    For executing the command, you can use a code like the following

    Sub MySubName
        Process.Start("C:\Windows\System32\inetsrv\appcmd set config yada-yada-yada...")
    End Sub
    

    I’ve never used the appcmd command line tool, so you’ll need to look at the documentation, and understand how to use it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Anybody know how to programmatically add an IP address to a Server 2008 Windows
Does anybody know how I can programmatically check (using C#) whether my program will
does anybody know how to add a child key to the root key programmatically
Does anybody know how to programmatically disable the keyboard individual letter pop-up? (This blue
Does anybody know how to programmatically set the text of a button? thing is
Does anybody know how to generate .mht file programmatically in C#, with embedded images
Anybody know of a way to batch NHibernate queries using NHibernate.Linq like you can
Anybody know ,what is the logic behind Thread.sleep in java? . Are they using
Does anybody know how to programmatically update the content of any of the standard
Does anybody know how to programmatically enlarge a flex 3 button's hitArea. Is there

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.