- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
Our community just got stronger! Explore new identity security resources, connect with experts, and discover more ways to learn and collaborate.
06-14-2021 10:11 AM
Hello,
Trying to launch powershell as targetusername. This PS session will server as interactive session to manage AD domain.
This is the setup.
Preveileged user/Targetusername = ADMUSER1
Global Const $CLIENT_EXECUTABLE = "C:\Windows\System32\WindowsPowerShell\v1.0\powershell_ise.exe" ;
$ConnectionClientPID = RunAs($TargetUsername, $TargetDomain, $TargetPassword,2, $CLIENT_EXECUTABLE, "", @SW_SHOWMAXIMIZED) ;
All fine, am able to launch powershell session. But this session is launched as shadow user ($env:username gives shadow username). May be this is all expected behavior. However shadow user will not have any permission to manage AD.
Question is, how to start powershell session as targetusername instead of shadow user?
Any help/insights appreciated.
Thanks.
06-14-2021 06:40 PM
Hi @Kaizen101 Cyber ,
I checked this link here can help, it seems a question similar to your problem and some tips on how to follow even using autoit.
https://community.cyberark.com/s/feed/0D55000005wsKqnCAE
06-14-2021 06:40 PM
Hi @Kaizen101 Cyber ,
I checked this link here can help, it seems a question similar to your problem and some tips on how to follow even using autoit.
https://community.cyberark.com/s/feed/0D55000005wsKqnCAE
06-16-2021 08:45 AM
Thanks for the reply.
I was able to get it working with changing logon_flag to 0 with RunAs command.
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!

