I am currently running the PowerShell script below to capture errors:
# Declare Variables
$Information = Import-Csv "c:\scripts\GUIDIssue\UPNList.csv"
# Connect to O365 Tenant
Connect-MsolService
foreach ($Info in $Information) {
(Get-MsolUser -UserPrincipalName $Info.UPN).errors.errordetail.objecterrors.errorrecord| fl > "C:\scripts\GUIDIssue\error.txt"
}
The output is the following: ErrorCode : ExA77C31 ErrorParameters : ErrorParameters ErrorDescription : Failed to enable the new cloud archive 00000000-0000-0000-0000-000000000000 of mailbox b306e73d-4fdc-43e5-af00-518b13e962ab because a different archive 852910fe-67ed-4b7b-9e1a-ef70289d4c36 exists. To enable the new archive, first disable the archive on-premises. After the next Dirsync sync cycle, enable the archive on-premises again.
In the "ErrorDescription:" I need to get 852910fe-67ed-4b7b-9e1a-ef70289d4c36 and assign it as a variable. How can I do that?
How about something like: