There are several ways to start/stop an IIS site, in a way that does not require logon to the system. For example:
1) Command line via APPCMD:
C:\windows\system32\inetsrv\appcmd.exe stop site /site.name:"TestSite"
2) VBS script:
Set oIIS = GetObject("winmgmts:root\WebAdministration")
Set oSite = oIIS.Get("Site.Name='TestSite'")
oSite.Stop
Running these under a Windows user that is a member of Administrators group, gives me access denied -related error messages. While creating and deleting sites works fine under the same conditions. This also happens with UAC disabled.
I need to run this script automated, what access permissions should I set and where?
Maybe I could set permissions to my application somewhere in Windows, to run it under the highest privileges?
Windows Server 2008 R2