Solved

setting IIS anonymous user with vbscript / asdutil.vbs

Posted on 2008-10-17
5
474 Views
Last Modified: 2010-04-21
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.Network")
strComputer = objNetwork.ComputerName
'set IIS anon account
wscript.echo "Setting IIS account"
Set objShell = CreateObject("Wscript.Shell")
strRun1 = "cscript.exe C:\Inetpub\AdminScripts\adsutil.vbs set w3svc/anonymoususername " & strComputer &"\"& service_account_name
strRun2 = "cscript.exe C:\Inetpub\AdminScripts\adsutil.vbs set w3svc/anonymoususerpass " &  service_account_name
wscript.echo strRun1
wscript.echo strRun2
objShell.Run strRun1, 1, True
objShell.Run strRun2, 1, True
0
Comment
Question by:tomvburke
  • 4
5 Comments
 

Author Comment

by:tomvburke
Comment Utility
I noticed  that the user  I am setting  was  on "Web Sites" so I used the identifier  for the Default Web site being "1"  as in ..."set w3svc/1/anonymoususername"  but stuill does not seem to change the Default Web Site anon user/pw.
0
 
LVL 5

Accepted Solution

by:
si_shamil earned 500 total points
Comment Utility
try "set w3svc/1/root/anonymoususername"  and "set w3svc/1/root/anonymoususerpass"
0
 

Author Comment

by:tomvburke
Comment Utility
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 :-(
0
 

Author Comment

by:tomvburke
Comment Utility
Sorry Si Shamil,   It look promising  but  it  did not change the anonymous user for "Default Web Site"  under "Web Sites" of IIS.
0
 

Author Closing Comment

by:tomvburke
Comment Utility
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
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In this article we want to have a look at the directory attributes which are used by Microsoft to store the so called Security Identifiers (SID). These SIDs plays an important role in delegating and granting permissions and in authentication of trus…
Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now