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 $O365CredSolved13KViews1like5Commentsexpanding a System.Collections.Generic.List[string]
Im using the following code to add properties to an object $ten = Get-MsolCompanyInformation -TenantId $tenantItem $objTenantData = New-Object -TypeName system.object $objTenantData | Add-Member -Type NoteProperty -Name AuthorizedServiceInstances -value $ten.AuthorizedServiceInstances The problem is that some of the properties of the MsolCompanyInformation are lists (System.Collections.Generic.List[string]) I need help to get the contents of that list into $objTenantData as text. Can you help me? /MatsSolved10KViews0likes1Comment