Sep 24 2019 08:52 PM
Hi All,
I need some help here and I am fairly certain it is going to be easy for most of you Powershell guru's
So I have this:
$UserCredential = Get-Credential
Import-PSSession(New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection) -DisableNameChecking
$Mbx = (Get-Recipient -RecipientTypeDetails UserMailbox -ResultSize Unlimited | Select DisplayName, DistinguishedName)
Sometimes I get prompted for the password a second time with this message
Creating a new session for implicit remoting of "Get-Recipient" command...
From what I understand it is loosing the connection, but the line is immediately afterwards so I dont understand? Also if that is the case how do I ensure this doesn't happen?
Any help is greatly appreciated.
Thank you
Sep 24 2019 09:07 PM
It is very inconsistent.
I have also tried importing the session this way and it seems about the same
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session
Sep 25 2019 12:24 AM
It's a session disconnect/reconnect indeed, get used to it.
Sep 25 2019 05:44 PM
Well thats annoying.
BTW sorry for the account swap, I realised I had two accounts :)