2

I am in almost the same situation as the person who asked this question (link). The only difference is that I'm not writing a monitoring service but trying to get a WMI-based monitoring service to work.

However after reading the linked question (and its answers) I am able to run the "Get-WmiObject win32_logicaldisk -computername WINSRV.genericdomain.local" command in a PowerShell remote-session without getting the "access denied" error as I followed the steps mentioned in the accepted answer.

Unfortunately executing the "Get-WmiObject win32_service -computername WINSRV.genericdomain.local" command gives me the error which I mentioned above ("access denied").

That is why I'm wondering if there are any other permissions the user needs in order to be able to successfully use the command in a PowerShell remote-session.

So, my questions is: what permissions/rights does my user require for this?

2 Answers 2

1

I found out that you have to tweak the Service Control Manager security settings of Windows in order to get that command working.

I found the solution in this answer on stackoverflow.

Executing this command from the command prompt of the remote machine did the trick for me:

sc sdset SCMANAGER D:(A;;CCLCRPRC;;;AU)(A;;CCLCRPWPRC;;;SY)(A;;KA;;;BA)S:(AU;FA;KA;;;WD)(AU;OIIOFA;GA;;;WD)

People might want to read a little bit more about this topic. In this article you can find find some more informations on adjusting these settings.

0

You must allow WMI through the Windows Firewall

On the target machine, as an admin, at the command prompt type netsh firewall set service RemoteAdmin enable

Per your post, you've already handled the DCOM stuff. For your reference https://msdn.microsoft.com/en-us/library/Aa393266.aspx Follow the steps

  • To grant DCOM remote launch and activation permissions for a user or group
  • To grant DCOM remote access permissions

Make sure the account you desire to use has the appropriate WMI permissions. This reference link is excellent for the steps on authorizing users for WMI access on your local computer and the remote computer. https://technet.microsoft.com/en-us/library/cc771551.aspx

Also, just for your consideration, for Powershell remoting to work, PSRemoting must be enabled on the target computer you want to manage remotely with Powershell. https://4sysops.com/archives/enable-powershell-remoting/

2
  • Thanks a lot for your answer. It helped me to get sure that I had the DCOM settings done and the WMI permissions set correctly. It turned out that you have to tweak the Service Control Manager security settings in order to get that command working. I found the command which did the trick on stackoverflow. Here is the link to the answer: stackoverflow.com/a/4432737/5337142 . Nov 9, 2015 at 16:41
  • Gotcha. I am glad you got it solved and also I am glad to help! Nov 9, 2015 at 22:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .