FLOW DESIGNER - POWERSHELL ERROR - User credentials cannot be used for local connections

redth
Giga Expert

Hi,

I received the below error while executing the PowerShell script.

User credentials cannot be used for local connections

Please let me know what needs to be done.

 

9 REPLIES 9

Hi

Yes, I found a solution for this.
run the host as 127.0.0.1

find_real_file.png


Then it don't run the authentication against Mid server.
But the Powershell command required -Credential $Cred or other way to input the credentials 

Found some where the command doesn't support it so then you need to build a function around it.


Support and Troubleshooting - How custom PowerShell activity works (servicenow.com)
Hope it helps

Thanks for the info.

Were you using workflow editor or flow designer? Also, Can you please share the changes (the function used) you did for powershell script?

Hi

I'm doing in the Flow designer.

This I put in the functions, can be used as is to


$PSS = New-PSSession -ComputerName . -Credential $Cred
$Output = Invoke-Command -Session $PSS -ScriptBlock {

#Do stuff here

whoami


}
$Output 

 

Nayan Mahato
Tera Guru

This is because you cannot discover the server itself using credentials. Power-shell will not accept it and will throw a warning saying credentials cannot be used to local connections.

<?xml version="1.0" encoding="UTF-8"?><results probe_time="6828" result_code="0"><result><Warning>User credentials cannot be used for local connections </Warning><Warning>User credentials cannot be used for local connections </Warning><Warning>User credentials cannot be used for local connections </Warning><Warning>User credentials cannot be used for local connections </Warning><Warning>User credentials cannot be used for local connections </Warning><Warning>User credentials cannot be used for local connections </Warning><Warning>User credentials cannot be used for local connections </Warning><Warning>User credentials cannot be used for local connections </Warning><Warning>User credentials cannot be used for local

 Try to discover by using another mid server or You can Update the credentials to run the service account similar to discovery_credentials

It will always use the credentials the mid server service is running with when you discover itself.

 

Regards,

Nayan

Thank You Nayan! The information provided really helps!