Reputation: 31
I'm trying to find a host on ServiceNow, and we know that this uses WMI to do the discovery. I get the following problem in the discovery phase:
User credentials can not be used for local connections
I tried to execute the command directly from MID Server (192.168.1.186):
Get-WmiObject -Class Win32_OperatingSystem -Namespace root / cimv2 -ComputerName 192.168.1.196 -Credential WORKGROUP \ administrator
but I get the following error:
Get-WmiObject: User credentials can not be used for local connections
At line: 1 char: 1
+ Get-WmiObject -Class Win32_OperatingSystem -Namespace root / cimv2 -ComputerName 1 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo: InvalidOperation: (:) [Get-WmiObject], ManagementException
+ FullyQualifiedErrorId: GetWMIManagementException, Microsoft.PowerShell.Commands.GetWmiObjectCommand
while if I do not use -Credential, it works correctly.
This is screenshot of the Discovery Log:
Moreover, I execute MID Server using administrator user.
Upvotes: 0
Views: 3233
Reputation: 26
Try using localhost instead of ip without credentials Get-WmiObject -Class Win32_OperatingSystem -Namespace root / cimv2 -ComputerName localhost
Upvotes: 1