Running GET-RECIPIENT now fails under SCC connection RRS feed

  • Question

  • We have been successfully running an automated PowerShell script for over two years to put email account on Office 365 E-Discovery Case Hold through Security & Compliance Center (SCC) PowerShell remote session. As part of this script we have been executing command GET-RECIPIENT to validate if passed email address exists. Very recently this command started to return the following error:

    Error in mapping SQL parameter '@organizationalUnitRoot'
        + CategoryInfo          : NotSpecified: (:) [Get-Recipient], DataProviderMappingException
        + FullyQualifiedErrorId : [Server=BL2NAM02WS023,RequestId=e2bf7fa4-a5cb-48ea-b055-8c42ffa0cc95,TimeStamp=9/16/2019 9:22:33 PM] [FailureCategory=Cmdlet-DataProviderMappingException] 6BCA1 
        + PSComputerName        :

    The following is a simplified sample script which I can re-create the error in:

    $AdminAccount = ""
    $AdminPass = "Password"
    $PWord = ConvertTo-SecureString -String $AdminPass -AsPlainText -Force
    $credential = New-Object -TypeName "System.Management.Automation.PSCredential" -ArgumentList $AdminAccount, $PWord
    $emailaddress = ""
    $EXOPath = "C:\EXODir"
    $EXOFile = Join-Path $EXOPath "Microsoft.Exchange.Management.ExoPowershellModule.dll"
    $AADLFile = Join-Path $EXOPath "Microsoft.IdentityModel.Clients.ActiveDirectory.dll"
    Add-Type -Path $AADLFile
    Import-Module $EXOFile
    $Session = New-EXOPSSession -ConnectionUri '' -Credential $credential
    Import-PSSession $Session -AllowClobber -DisableNameChecking
    get-recipient -Identity $emailaddress 
    Remove-PSSession $Session

    I know that its still works under Exchange Online connection ( However, as i mentioned above, because of our specifics, we have been using it successfully under SCC connection and started getting errors only in the past few days.
    Has something recently was modified/updated in Office365 regarding access and/or use of GET-RECIPIENT command and specifically under SCC remote session?

    Please help! 

    Monday, September 16, 2019 9:34 PM


All replies