Running as targetusername

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

Welcome Idira to LIVEcommunity!

Our community just got stronger! Explore new identity security resources, connect with experts, and discover more ways to learn and collaborate.

Meet Idira

Running as targetusername

L2 Linker

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.

 

 

 

1 accepted solution

Accepted Solutions

L1 Bithead

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

View solution in original post

2 REPLIES 2

L1 Bithead

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

L2 Linker

Thanks for the reply.

 

I was able to get it working with changing logon_flag to 0 with RunAs command.

  • 1 accepted solution
  • 314 Views
  • 2 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

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!