' ========================================================== ' Author: Wade Wegner ' Create date: 06/13/2007 ' Description: Automate the task of assigning permissions ' File Name: AssignCSPermissions.vbs ' ========================================================== ' Declare the users Dim users(4) users(0) = "RunTimeUser" users(1) = "CatalogWebSvc" users(2) = "MarketingWebSvc" users(3) = "OrdersWebSvc" users(4) = "ProfilesWebSvc" ' Run the Load method Load Sub Load() ' Write permissions to the catalog auth role strObject = "C:\Inetpub\wwwroot\CatalogWebService\CatalogAuthorizationStore.xml" UpdatePermissions strObject, users(1) ' Write permissions to temporary ASP.NET folder strObject = "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files" For Each user IN users UpdatePermissions strObject, user Next ' Write permissions to the Windows temporary folder strObject = "C:\WINDOWS\Temp" For Each user IN users UpdatePermissions strObject, user Next End Sub ' Update the permissions of the folder/file Sub UpdatePermissions(strLocation, strUser) Set objShell = CreateObject("Wscript.Shell") ' Make sure to have the xcacls.vbs file available. Download from: ' http://download.microsoft.com/download/f/7/8/f786aaf3-a37b-45ab-b0a2-8c8c18bbf483/xcacls_installer.exe objShell.Run "xcacls.vbs """ + strLocation + """ /G " + strUser + ":XW /E", 2, True End Sub