Page 1 of 1

WinMgmts Permission

Posted: Thu Dec 06, 2007 4:41 am
by tomlon
I have created a script that starts / restarts two particular services on remote computers. It works fine if I am running the script (I am DomainAdmin), however, a plain vanilla user runs it and they receive a Permission Denied : 'GetObject' error. The code os 800A0046. The line it references is

Set objWMIService = GetObject("winmgmts:" & strSVR & "rootcimv2")


Now, I do know that for the user (if they are not local admin) needs to be granted permission to stop/restart services. I have used the SUBINACL and successfully granted the users the right to the particualr services. But I am not sure what permissions I need to grant to allow the user to run this line of code. Thanks

WinMgmts Permission

Posted: Thu Dec 06, 2007 4:41 am
by tomlon
I have created a script that starts / restarts two particular services on remote computers. It works fine if I am running the script (I am DomainAdmin), however, a plain vanilla user runs it and they receive a Permission Denied : 'GetObject' error. The code os 800A0046. The line it references is

Set objWMIService = GetObject("winmgmts:" & strSVR & "rootcimv2")


Now, I do know that for the user (if they are not local admin) needs to be granted permission to stop/restart services. I have used the SUBINACL and successfully granted the users the right to the particualr services. But I am not sure what permissions I need to grant to allow the user to run this line of code. Thanks

WinMgmts Permission

Posted: Fri Dec 07, 2007 3:33 am
by jvierra
The SC command can run remotely.

Not a good idea to elevate standard users and give them elevated remote permissions. This can lead to serious trouble.

SC should work as long as the user has permission on the remote object and machine.

WinMgmts Permission

Posted: Fri Dec 07, 2007 4:31 am
by jvierra
The service is a remote object in this case.