JustinGrote / JustinGrote/Scripts

Invoke-WmiMethod access denied

Open
#1 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
PowerShell
Stars
34
Forks
11
PR merge metrics
No merged PRs in 30d

Description

Hi I tried your script. I am logged in with a domain admin account and want to push a read-only user to a server for wmi monitoring. I ran the script, and when prompted to provide the Identity, I specified the domain user account. I received an access denied message. Also I was not prompted to provide the computer name of the server I want to install this account on and monitor read-only. Is this script to be run on the server I want the account installed on?

```
PS C:\Users\domainadmin\Desktop\setupWMI\setNetmonPermissions> .\Set-WMIReadOnlyAccess.ps1
cmdlet Set-WMIReadOnlyAccess.ps1 at command pipeline position 1
Supply values for the following parameters:
Identity: netmon
WARNING: Exception calling "add" with "1" argument(s): "Access is denied.
"
WARNING: Exception calling "add" with "1" argument(s): "Access is denied.
"
Invoke-WmiMethod : Access denied
At C:\Users\domainadmin\Desktop\setupWMI\setNetmonPermissions\Set-WMIReadOnlyAccess.ps1:238 char:19
+ $output = Invoke-WmiMethod @invokeparams -Name GetSecurityDescriptor
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Invoke-WmiMethod], ManagementException
+ FullyQualifiedErrorId : InvokeWMIManagementException,Microsoft.PowerShell.Commands.InvokeWmiMethod
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.