« Previous Next »

Answered Thread: Add IIS Manager User via Script

Last post 10-23-2009 6:48 PM by kirrilian. 3 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (4 items)

Sort Posts:

  • 10-23-2009, 3:08 PM

    Add IIS Manager User via Script

    I am able to add users to the configuration using one of the scripts I found on this site however the password is unencrypted and the user is unable to authenticate unless the password is unencrypted. Examples: (from administration.config) (doesnt work) <add name="ContosoUser" password="P@ssw0rd" /> (works) <add name="ContosoUser" password="B03DDF3CA2E714A6548E7495E2A03F5E824EAAC9837CD7F159C67B90FB4B7342" /> I'm using the vbs from here: http://www.iis.net/ConfigReference/system.webServer/management/authentication/credentials I don't care if the password is encrypted or not, I just need to script adding them, I have about 200 users to add and I don't really want to do it by hand :(. Thanks, Glen
  • 10-23-2009, 4:43 PM In reply to

    Answered Re: Add IIS Manager User via Script

    I just posted information on how you can achieve this from a command line if you can use PowerShell, otherwise C# code would be the next best option.

    http://blogs.msdn.com/carlosag/archive/2009/10/23/adding-iis-manager-users-and-permissions-through-powershell.aspx

     

  • 10-23-2009, 5:12 PM In reply to

    Re: Add IIS Manager User via Script

    Thank you very much!
  • 10-23-2009, 6:48 PM In reply to

    Re: Add IIS Manager User via Script

    Here is my powershell script if anyone wants it. #load assembly [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Web.Management") #load users $users = Import-Csv users.csv foreach ($line in $users) { write-host Creating user $line.user with password $line.password [Microsoft.Web.Management.Server.ManagementAuthentication]::CreateUser($line.user , $line.password) } and users.csv: user,password user1,password1 user2,password2 user3,password3
Page 1 of 1 (4 items)
Microsoft Communities