Set the "Run As" for a Powershell Step in Flow Designer

dc20
Tera Guru

I have a powershell script located on a windows "server A" that is not the mid server.

We are able to log into the windows server as "user 1", launch powershell and run the script.

Now we need to be able to configure the Powershell Step in Flow Designer to execute the script as "user 1".

I set up a credential/connection alias that has "server A" in the connection and "user 1" in the credential.

When I configure the Powershell Step using that alias and explicit remoting, the script is triggered but it's not using "user 1" as the "run as" user.  It's using NT AUTHORITY\ANONYMOUS LOGON'.

Any ideas on how to configure the Step to execute the powershell as the user defined in the credential alias?

2 REPLIES 2

Community Alums
Not applicable

Hi dc,

I created the Credential Alias entry under IntegrationHub -> Connection & Credential Aliases.  My Alias name is "SuperAdmin".

I then went into the Orchestration -> Credentials and had to add the column for "Credential Alias" in the view.  I selected my "SuperAdmin" as the alias to be associated with my Orchestration Credential and saved it.  Going back to the Credential Aliases, I saw that credential listed under the "SuperAdmin" alias.

This is what i got from  richardbrounstein in this post.

Mark my answer correct & Helpful, if Applicable.

Thanks,

Sandeep

Shawn Gienow
Tera Guru

One option you have is to use an encrypted credential file for that one in PS itself.

$credxml = "C:\path\creds.xml"
$StoredCredentials = Get-Credential
$StoredCredentials | Export-Clixml -Path $credxml

Load the creds with:
$Script:Credentials = Import-Clixml -Path C:\path\creds.xml;


Note, you do need to update it any time you change the password of the account you're using, but its one way around things, if you need multiple different credentials running from a single script.