IIS 7 and Above
Configuration & Scripting
Configuration of IUSR group with IIS7
Last post Jan 17, 2007 07:30 AM by ecl
Jan 11, 2007 02:24 AM|ecl|LINK
I develop a client/server application which is using IIS7 with Vista.
I would like to change ACL for files and directory of my application.
With IIS6, I use the user group IUSR_<Machine name> which has been replace by IUSR for Vista.
But when I try to add this user group, I cannot find it in WIN32_Account and I don’t know its SID name.
Here is my code :
Set objWMI = GetObject("winmgmts:\\.\root\cimv2")
'Get a collection of Users objects, using ExecQuery
Set colUsers = objWMI.ExecQuery("SELECT * FROM WIN32_Account WHERE Name = IUSR")
'The collection should only have one user in it. Loop through the one user collection
'and create a user object
For Each userName in colUsers
Set objUserName = userName
getInternetUserSID = objUserName.SID
-> The variable colUsers is always empty.
Help will be appreciated.
Jan 12, 2007 12:03 AM|qbernard|LINK
The IUSR is an built in system account like network services. Not sure how to get its SID, what about granting the iis_iusrs group ?
Jan 16, 2007 04:51 AM|ecl|LINK
Jan 16, 2007 11:44 PM|qbernard|LINK
Ok, I test it on my vista and this works.
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set objAccount = objWMIService.Get _
Since it's a builtin account, it will be short:
network service - S-1-5-20
iusrs - S-1-5-17
iis_iusrs - S-1-5-32-568
It will be the same for your Vista
Jan 17, 2007 07:30 AM|ecl|LINK
It works with my vista