Extra Credential Prompt

%3CLINGO-SUB%20id%3D%22lingo-sub-873646%22%20slang%3D%22en-US%22%3EExtra%20Credential%20Prompt%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-873646%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20All%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20need%20some%20help%20here%20and%20I%20am%20fairly%20certain%20it%20is%20going%20to%20be%20easy%20for%20most%20of%20you%20Powershell%20guru's%26nbsp%3B%3CIMG%20class%3D%22lia-deferred-image%20lia-image-emoji%22%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Fhtml%2Fimages%2Femoticons%2Fsmile_40x40.gif%22%20alt%3D%22%3Asmile%3A%22%20title%3D%22%3Asmile%3A%22%20%2F%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20I%20have%20this%3A%3C%2FP%3E%3CPRE%3E%24UserCredential%20%3D%20Get-Credential%3CBR%20%2F%3EImport-PSSession(New-PSSession%20-ConfigurationName%20Microsoft.Exchange%20-ConnectionUri%20https%3A%2F%2Foutlook.office365.com%2Fpowershell-liveid%2F%20-Credential%20%24UserCredential%20-Authentication%20Basic%20-AllowRedirection)%20-DisableNameChecking%3CBR%20%2F%3E%24Mbx%20%3D%20(Get-Recipient%20-RecipientTypeDetails%20UserMailbox%20-ResultSize%20Unlimited%20%7C%20Select%20DisplayName%2C%20DistinguishedName)%20%3C%2FPRE%3E%3CP%3ESometimes%20I%20get%20prompted%20for%20the%20password%20a%20second%20time%20with%20this%20message%3C%2FP%3E%3CPRE%3ECreating%20a%20new%20session%20for%20implicit%20remoting%20of%20%22Get-Recipient%22%20command...%3C%2FPRE%3E%3CP%3EFrom%20what%20I%20understand%20it%20is%20loosing%20the%20connection%2C%20but%20the%20line%20is%20immediately%20afterwards%20so%20I%20dont%20understand%3F%26nbsp%3B%20Also%20if%20that%20is%20the%20case%20how%20do%20I%20ensure%20this%20doesn't%20happen%3F%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20help%20is%20greatly%20appreciated.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-873646%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExchange%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-873669%22%20slang%3D%22en-US%22%3ERe%3A%20Extra%20Credential%20Prompt%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-873669%22%20slang%3D%22en-US%22%3E%3CP%3EIt%20is%20very%20inconsistent.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20also%20tried%20importing%20the%20session%20this%20way%20and%20it%20seems%20about%20the%20same%3C%2FP%3E%3CPRE%3E%24Session%20%3D%20New-PSSession%20-ConfigurationName%20Microsoft.Exchange%20-ConnectionUri%20https%3A%2F%2Foutlook.office365.com%2Fpowershell-liveid%2F%20-Credential%20%24UserCredential%20-Authentication%20Basic%20-AllowRedirection%3CBR%20%2F%3EImport-PSSession%20%24Session%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-873859%22%20slang%3D%22en-US%22%3ERe%3A%20Extra%20Credential%20Prompt%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-873859%22%20slang%3D%22en-US%22%3E%3CP%3EIt's%20a%20session%20disconnect%2Freconnect%20indeed%2C%20get%20used%20to%20it.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-875930%22%20slang%3D%22en-US%22%3ERe%3A%20Extra%20Credential%20Prompt%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-875930%22%20slang%3D%22en-US%22%3E%3CP%3EWell%20thats%20annoying.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBTW%20sorry%20for%20the%20account%20swap%2C%20I%20realised%20I%20had%20two%20accounts%20%3A)%3C%2Fimg%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

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 :smile: 

 

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

3 Replies
Highlighted

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
Highlighted

It's a session disconnect/reconnect indeed, get used to it.

Highlighted

Well thats annoying.

 

BTW sorry for the account swap, I realised I had two accounts :)