4 years ago
WMI is not accessible
Hi All i am facing issue on one of my domain controller. i am seeing the below error message.
LMD30496067 warn - DC01.mydomain.com WMI is not accessible. See error message for likely issue.-1...
From a PowerShell perspective (not directly LM), -Credential (Get-Credential) would prompt you for credentials. If LM is running that command, it probably wouldnt work. Because it would need to interact with the credential box. Instead, you would have to pass credentials to the command.
There are several different ways to do this.
Here is a simple way to test:
$scriptUser = "domain\testaccount"
$scriptPassword = "aPasswordForMyAccount"
$scriptPass = ConvertTo-SecureString -String $scriptPassword -AsPlainText -Force
$secureScriptCreds = [PSCredential]::new($scriptUser, $scriptPass)
Get-WMIObject -Computername DC01.mydomain.com -Credential $secureScriptCreds -Query {select * from win32_operatingsystem} Note: I would not recommend storing plaintext credentials in your scripts. You might be able to pass them with a LogicMonitor property
Also, if the powershell process is running with an account that has permissions, you may not even need to include the -Credential parameter in the powershell script. It should run as that account.