[Last Call] Learn how to a build a cloud-first strategyRegister Now


Active directory domain change for IIS V6 web server - Is there a way to update the virtual directories web user via script?

Posted on 2011-10-25
Medium Priority
Last Modified: 2013-08-02
we am in the process of creating a development environment for our web infrastructure.      We have cloned our content managment system and several web servers  {2003/iisv6} to a dev environment.    The web servers are now joined to a separate dev domain.   This is a copy of our production domain,   ie same usernames/  but different passwords and different domain name.

My question is,   does anyone have/know of a script of util that I can use to update the anonymous user on all of the virtual directories on the webservers?     Given that the web server has well over one hundred virtuals configured with different users,   it would be great if it would read the existing user,  and update it to the new domain.   {domaina\username --> domainb\username | new pass}

Any insights would be appreciated :)
Question by:fertigj
  • 2

Assisted Solution

morpheios earned 2000 total points
ID: 37029353
Set adminManager = CreateObject("Microsoft.ApplicationHost.WritableAdminManager")
adminManager.CommitPath = "MACHINE/WEBROOT/APPHOST"

Set anonymousAuthenticationSection = adminManager.GetAdminSection("system.webServer/security/authentication/anonymousAuthentication", "MACHINE/WEBROOT/APPHOST/Contoso")
anonymousAuthenticationSection.Properties.Item("enabled").Value = True
anonymousAuthenticationSection.Properties.Item("userName").Value = "IUSR"
anonymousAuthenticationSection.Properties.Item("password").Value = "P@ssw0rd"


Open in new window


Accepted Solution

morpheios earned 2000 total points
ID: 37029365
For powershell example see http://www.eggheadcafe.com/articles/20010609.asp

Anything some:

 $server = "localhost"
 $siteName = "www.centroso.com"
 $iis = [ADSI]"IIS://$server/W3SVC"
 $site = $iis.children | where { $_.keyType -eq "IIsWebServer" -and $_.ServerComment -eq $siteName }
 $path = [ADSI]($site.path+"/ROOT")
 $path.AnonymousUserName = "IUSR"
 $path.AnonymousUserPass = "P@ssw0rd"
 $path.AuthFlags = 3

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Screencast - Getting to Know the Pipeline

834 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