Office 365 Administration
2 TopicsO365 Script - credentials prompt
Hi All I have long running scripts running against O365 for our tenant. These can take a day or two to complete. During the run of the script, there can be an interuption where the credentials manager popup requests the credentials again, despite me having entered them at the beginning of the script. I can't find a way to handle this programatically so that the creds are returned and the script continues. Can anyone help? Here's the code for the connection at the start of the script: Import-Module MSOnline $O365Cred = Get-Credential $O365Session = New-PSSession –ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Credential $O365Cred -Authentication Basic -AllowRedirection Import-PSSession $O365Session Connect-MsolService –Credential $O365CredSolved13KViews1like5Comments