1

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

Slava
  • 201
  • 3
  • 11
  • Could `PsExec` be an option ? (works like a charm for me) – krisFR Feb 20 '14 at 04:20
  • @user2196728 That would work, but would also lead to 2 major security flaws. You have to enable the built-in Administrator account, and you will have to store Administrator login credentials unencoded. Most probably just in plan text format. – Slava Feb 20 '14 at 14:19

0 Answers0