Using run tool to run a powershell script as an admin without prompting for credentials
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi All, I've been stuck on this issue for a while. I am trying to create a workflow that will automate adding accounts to active directory groups. I have a powershell script that will actually add the members. The issue is that to make changes in active directory, the script has to be run as admin. I haven't been able to figure out how to do this while using Alteryx as a non-admin. I've tried writing another script that would execute the add member script as an admin, but I haven't been able to get that to work. I just wanted to post this here and see if maybe there's some work around I haven't considered. Thank you in advance for any replies.
Solved! Go to Solution.
- Labels:
- Run Command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi, @Jakem45
Add below sample code before your powershell script body: (please replace your admin name and password in it)
$securePassword = ConvertTo-SecureString "Password123" -AsPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential("Administrator", $securePassword)
Start-Process powershell -Verb runAs -Credential $credential
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you!!
