Link to home
Start Free TrialLog in
Avatar of ukkaapie
ukkaapie

asked on

Connect to separate established powershell session

Hi,

Is there a way to establish a powershell session to a server and use that session in a separate powershell process?

The powershell session I create will be authenticated using MFA and to stop using MFA for each and every powershell session that may be used in a script I would like to use a separate established connection.

I appreciate the security implications of this but would like to first find out if this is possible.

Any help would be greatly appreciated.

Thank you
Avatar of Jian An Lim
Jian An Lim
Flag of Australia image

Everytime you fire up a new session, MFA should kick in. Unless you make it as trusted for X days but I don't see that possible

what was your problem again?

You open a powershell, and you connect to office 365; MFA triggered.
You run powershell script within the powershell; you want MFA to be triggered again?
Avatar of ukkaapie
ukkaapie

ASKER

Hi Jian,

We run a script from within AD Users and Computers (taskpad) which feeds parameters to the script.  This is a new PS session each time the script runs which therefore kicks MFA off each time.

I was wondering if it is possible to have an open session on my desktop and for separate scripts to use that session information each time.  Each session being separate from each other.
why MFA kicks in ?

if your security are even that tight within the company; then MFA will stick the way you want.

what type of MFa you are talking and what type of script will call MFA up?
When we connect to Exchange Online through powershell (or IE for that matter) we have to log in with MFA
now i understood. I believe you can whitelist the IP address so it won't need MFA.

but thats a security question.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.