Talk About Network

Google





Software > Application Center Admin > RE: ip restrict...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 6 Topic 1111 of 1168
Post > Topic >>

RE: ip restriction setting and syncronization

by wjzhang@[EMAIL PROTECTED] ("WenJun Zhang[msft]") Oct 25, 2007 at 02:04 PM

Hi Jason,

You may consider writing some scripts to manually set the IPSecurity 
properties. I attached some samples here for your reference.

setIP.txt
====================
Option explicit 
dim objIpServer
dim objIPSec
dim arHostsRead
dim nCounter
dim IpToaddStr
dim tmpStr
IpToaddStr= "134.0.0.1, 255.255.255.0"

if(instr(IpToAddStr,", ")<1) then
wscript.echo "IpAddress for grant is NOT in the correct format"
wscript.echo "IP to Add : "+IpToaddStr
wscript.echo "Format Sample: 123.0.0.1, 255.255.255.255"
wscript.echo "Program exits"
wscript.quit
end if

set objIpServer=GetObject("IIS://localhost/W3Svc/1/root") 
objIpServer.getinfo
wscript.echo "Got the IP list object"
SET objIPSec = objIpServer.get("IPSecurity")
wscript.echo "Got IP List"

arHostsRead=objIPSec.IPGrant

for nCounter=0 to ubound(arHostsRead) 
tmpStr = arHostsRead(nCounter)
wscript.echo tmpStr 
if tmpStr=IpToAddStr then
wscript.echo "The new record is already in the IP list"
wscript.echo "No need to add"
wscript.echo "Program exits"
wscript.quit
return 
end if
next

redim preserve arHostsRead (UBound(arHostsRead)+1)
arHostsRead (UBound(arHostsRead)) = IpToAddStr


objIPSec.ipgrant=arHostsRead 
objIPSec.grantbydefault=false

objIpServer.put "IPSecurity" ,objIPSec
wscript.echo "Setting info" 
objIpServer.setinfo
wscript.echo "Done"

ReadSetting.txt 
==================
Option explicit 
dim objIpPServer
dim objIPSec
dim nCounter
dim arHostsRead

set objIpPServer=GetObject("IIS://localhost/w3svc/1/root")
objIpPServer.getinfo
wscript.echo "Got IP list For Grant" 
SET objIPSec = objIpPServer.get("IPSecurity")
arHostsRead=objIPSec.IPGrant
for nCounter=0 to ubound(arHostsRead) 
wscript.echo arHostsRead(nCounter)
next


Thanks and have a nice day.

Sincerely,

WenJun Zhang

Microsoft Online Community Sup****t

==================================================

Get notification to my posts through email? Please refer to: 
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup sup****t offering is for non-urgent issues

where an initial response from the community or a Microsoft Sup****t 
Engineer within 1 business day is acceptable. Please note that each follow

up response may take approximately 2 business days as the sup****t 
professional working with you may need further investigation to reach the 
most efficient resolution. The offering is not appropriate for situations 
that require urgent, real-time or phone-based interactions or complex 
project analysis and dump analysis issues. Issues of this nature are best 
handled working with a dedicated Microsoft Sup****t Engineer by contacting 
Microsoft Customer Sup****t Services (CSS) at:

http://msdn.microsoft.com/subscriptions/sup****t/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no
rights.
 




 6 Posts in Topic:
ip restriction setting and syncronization
=?Utf-8?B?SmFzb24=?= <  2007-10-19 05:51:02 
RE: ip restriction setting and syncronization
wjzhang@[EMAIL PROTECTED]  2007-10-22 06:40:01 
RE: ip restriction setting and syncronization
wjzhang@[EMAIL PROTECTED]  2007-10-23 12:17:39 
RE: ip restriction setting and syncronization
=?Utf-8?B?SmFzb24=?= <  2007-10-23 06:01:01 
RE: ip restriction setting and syncronization
wjzhang@[EMAIL PROTECTED]  2007-10-25 14:04:01 
RE: ip restriction setting and syncronization
wjzhang@[EMAIL PROTECTED]  2007-10-29 13:19:11 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Wed Jan 7 14:29:53 PST 2009.