WinMgmts Permission

Anything VBScript-related, including Windows Script Host, WMI, ADSI, and more.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 16 years and 4 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
tomlon
Posts: 2
Last visit: Thu Dec 06, 2007 3:41 am

WinMgmts Permission

Post 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
User avatar
tomlon
Posts: 2
Last visit: Thu Dec 06, 2007 3:41 am

WinMgmts Permission

Post 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
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

WinMgmts Permission

Post 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.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

WinMgmts Permission

Post by jvierra »

The service is a remote object in this case.
This topic is 16 years and 4 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked