0

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:

enter image description here

Moreover, I execute MID Server using administrator user.

1 Answer 1

1

Try using localhost instead of ip without credentials Get-WmiObject -Class Win32_OperatingSystem -Namespace root / cimv2 -ComputerName localhost

2
  • using localhost without credentials good working, but Why I dont have use the credentials in this case?
    – gaten
    Apr 27, 2018 at 8:55
  • Someone identified as "Peter" claims that "if the your App which you use for scanning runs local on the DC, it is not possible to do this by setting a Username/Password. For local actions the logged on user will be used automatically". Someone else suggests that you cannot pass in the username/password when on the local machine. This assumes that you're logged into the local computer with admin privileges. Apr 27, 2018 at 15:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.