Launching PowerShell via AutoIt with Domain User - Issue Running Connect-ExchangeOnline command.

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

Launching PowerShell via AutoIt with Domain User - Issue Running Connect-ExchangeOnline command.

L1 Bithead

Hi Community,

 

I am currently working with CyberArk Privileged Cloud and using AutoIt to launch a PowerShell session. From there, I open a new PowerShell window under a domain user context using the runas command.

 

Once inside the new PowerShell window (as the domain user), I try to run the following command:

  • Import-Module ExchangeOnlineManagement
  • Connect-ExchangeOnline -UserPrincipalName [email protected]

 

However, it is throwing an error (screenshot attached/mentioned below). The same command works perfectly fine when run manually outside the CyberArk session or directly from a domain user login.

 

Some additional observations:

 

  • The session initially opens as a local user.
  • AutoIt is being used to inject credentials and automate launching the second PowerShell window.

 

Has anyone successfully managed a similar setup—launching a PowerShell session as a domain user from within CyberArk (via AutoIt or another method) and running Exchange Online commands?

 

Any guidance or suggestions would be appreciated.

 

Find the error screenshot below:

 

Field_Content_versions_oct20__068Vy00000dDEJlIAO.pngthank you.

 

 

5 REPLIES 5

L4 Transporter

Not sure if you have done this already but it is probably worth logging in to the PSM through RDP and then from there, manually doing runas with the user on powershell.

 

I t could be an issue with the powershell version the PSM or some pre-reqs?

 

Assume connectivity is there but yeah, trying this manually would be my first thing to do to see if you get the same issues.

 

Also, compare versions from where it does work and where it does not.

L1 Bithead

Hi @Nathan Southgate​,

 

thanks for replying.

 

I tried manually running those commands then these commands are working fine but while launching through CyberArk I am getting those errors. Could you please help here.

Thanks.

L4 Transporter

Hi @NAVEEN KUMAR PAMMI​

 

Have you ruled out App Locker? as a temporary measure for troubleshooting, put App Locker into Audit mode on the PSM Server and try again.

 

Thanks

 

Michael

L1 Bithead

Hi @Michael C L McAughey​ 

 

Yes, I have put the app locker rules to Audit mode. Can you suggest if there is any other way to launch PowerShell as domain user or any other suggestions that would help.

 

Thanks,

Naveen.

Having the same issue here. Let us know if any workaround is found. Thank You.

  • 165 Views
  • 5 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!