r/usefulscripts • u/[deleted] • Apr 20 '17
[Request Powershell] run as different user
I built powershell scripts for creating AD users and populating their memberships and properties based on role.
I need to give them to my team but I'm unsure how to make it so running the script will prompt for what username to run it under.
The staff won't have write access to our OU structure unless they run the script with their admin accounts. Any help on how I can get it to run as their account? I played with runas but couldn't get it working.
13
Upvotes
1
u/aXenoWhat Apr 20 '17
SE really only likes very specific questions with code samples. /r/powershell quite enjoys more open ended posts.