FLOW DESIGNER - POWERSHELL ERROR - User credentials cannot be used for local connections
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2020 12:47 PM
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.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2021 09:17 PM
Hi
Yes, I found a solution for this.
run the host as 127.0.0.1
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2021 07:36 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2021 10:22 PM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2022 02:43 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2022 12:25 PM
Thank You Nayan! The information provided really helps!