Flow Designer - PowerShell - Different Credentials
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2022 01:46 AM
I'm looking to use a custom action in Flow Designer that creates and permissions a network folder using variables passed from the catalog item into the PowerShell script.
New-Item -Path ${project} -ItemType Directory
$NewAcl = Get-Acl -Path ${project}
# Set properties
$identity = ${group}
$fileSystemRights = "Modify"
$type = "Allow"
# Create new rule
$fileSystemAccessRuleArgumentList = $identity, $fileSystemRights, $type
$fileSystemAccessRule = New-Object -TypeName System.Security.AccessControl.FileSystemAccessRule -ArgumentList $fileSystemAccessRuleArgumentList
# Apply new rule
$NewAcl.SetAccessRule($fileSystemAccessRule)
Set-Acl -Path ${project} -AclObject $NewAcl
When I created the action I've defined the PS step Connection Alias as our sn_ad_spoke.AD one since this account has permission to create folders in our desired location. When testing I ran it against a sub-prod file share and it worked as expected. During final stages of testing against the production file share it was throwing back Access Denied despite permissions being fine and the script running in PS direct using the Connection Alias credentials. Turns out the initial tests were running using the MID server service account.
How can I get this action to use specific credentials?
Cheers!
- Labels:
-
Flow Designer
-
MID Server
-
Orchestration

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2022 02:04 AM
Hi,
There is no way to define what user should run a specific Flow action.
A flow action runs with the user as defined by the Flow/subflow calling that action.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-29-2022 02:30 AM
Thanks
I'll raise a HI call since this doesn't seem sensible!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-05-2022 01:43 AM
Please report back what answers you get from Now Support (HI).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-18-2024 09:48 AM
Is your issue resolved by ServiceNow.