Hello everybody,
i have a qustion to the PowerShell Sessions and can not find any answere to my problem.
I want to write a script that opens a PSSession to our exchange server to get the cmdlts from the exchange shell.
Unfortunately the pssession opens so slowly that i want to know how i can get it faster or how i can save the session on my computer to start it faster in a next scriptrun?
Is it possible? Or is there an other way?
Best regards
PowerShell Session
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: PowerShell Session
Not really a scripting issue. The speed is dependent on the server. If it is very busy or low on resources it can be very slow.
There is no way to persist a session.
How long does Enter-PsSession take? 10 seconds is not abnormal.
There is no way to persist a session.
How long does Enter-PsSession take? 10 seconds is not abnormal.
Re: PowerShell Session
Okay, thats sounds not so good. But asking costs nothing.
I've tried it now and it takes about 5 seconds to load the session and commands. Its not so long but how i can manage it, when i put this script in a task schedule and run this all 5 minutes? The script would opens all 5 minutes a new session or is there a way to save it?
I also think about this problem because I have a script that builds up three sessions in a row (Exchange, AD, Skype). With all three sessions the scripts starts 45-60 seconds.
I've tried it now and it takes about 5 seconds to load the session and commands. Its not so long but how i can manage it, when i put this script in a task schedule and run this all 5 minutes? The script would opens all 5 minutes a new session or is there a way to save it?
I also think about this problem because I have a script that builds up three sessions in a row (Exchange, AD, Skype). With all three sessions the scripts starts 45-60 seconds.
Re: PowerShell Session
What I want to say is that i will implement my script into a task scheduler that run every 5 minutes. This script will open each run a new session to the exchange. The question is whether i can save with the first run the session that my script doesnt open every time a new session to save time at the startup.
(This would help me also when I start my next script where i need to open three different sessions [AD, Exchange, Skype])
(This would help me also when I start my next script where i need to open three different sessions [AD, Exchange, Skype])