tomvburke
asked on
setting IIS anonymous user with vbscript / asdutil.vbs
Using script below I am trying to change the anon user for IIS 6 2003 Srv from IUSR_<machinename> to a local user I created. I get no errors, however when I check default web site with IIS mmc gui the anon user does not change. When I view anon user with adsutil it shows it did change. Anyone have idea what I am doing wrong? Thanks.
service_account_name = "svcacct"
Set objNetwork = CreateObject("Wscript.Netw ork")
strComputer = objNetwork.ComputerName
'set IIS anon account
wscript.echo "Setting IIS account"
Set objShell = CreateObject("Wscript.Shel l")
strRun1 = "cscript.exe C:\Inetpub\AdminScripts\ad sutil.vbs set w3svc/anonymoususername " & strComputer &"\"& service_account_name
strRun2 = "cscript.exe C:\Inetpub\AdminScripts\ad sutil.vbs set w3svc/anonymoususerpass " & service_account_name
wscript.echo strRun1
wscript.echo strRun2
objShell.Run strRun1, 1, True
objShell.Run strRun2, 1, True
service_account_name = "svcacct"
Set objNetwork = CreateObject("Wscript.Netw
strComputer = objNetwork.ComputerName
'set IIS anon account
wscript.echo "Setting IIS account"
Set objShell = CreateObject("Wscript.Shel
strRun1 = "cscript.exe C:\Inetpub\AdminScripts\ad
strRun2 = "cscript.exe C:\Inetpub\AdminScripts\ad
wscript.echo strRun1
wscript.echo strRun2
objShell.Run strRun1, 1, True
objShell.Run strRun2, 1, True
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you , I will let you know if this works. I should be able to test tonight once my infrastructure repairs whatever is wrong with our routing to test systems :-(
ASKER
Sorry Si Shamil, It look promising but it did not change the anonymous user for "Default Web Site" under "Web Sites" of IIS.
ASKER
Thanks, sorry I muist have been tired when I tested, I had the orer wrong when I did the test of "... root/1..." , Your solution worked well.
Thank you si shamil
Thank you si shamil
ASKER