-
Notifications
You must be signed in to change notification settings - Fork 618
Description
Hello,
I am exporting all security and compliance components using DSC but I am having a problem in one of the components (SCSecurityfilter). I have tried both credential and application with cert thumbprint but it is still giving me the same error below:
{WriteError}
System.Exception: |System.Exception|Please close the current PowerShell session and open a new session using Connect-IPPSSession with the -EnableSearchOnlySession flag. This requires using ExchangeOnlineManagement v3.9.0 or higher. Please make sure you have Organization Management role group and eDiscovery Admin role to execute the cmdlets.Exception: [2026-01-09T05:50:01.8232908Z] Cannot get security filters, error code Unauthorized.
"Error during Export:"
I am confused why the error is telling me to use the connect-ippssession while running the Export-M365DSCConfiguration -Components @("SCSecurityFilter") -Credential (Get-Credential) -Path <> or
Export-M365DSCConfiguration -Components @("SCSecurityFilter") -ApplicationId $ApplicationId -CertificateThumbprint $CertThumbprint -TenantId $TenantId -Path <>
I did try running first the connect-ipssession above with the v3.9.0 ExchangeOnlineManagement module and then run either the credential or application method of exporting dsc, but it is still giving me the error
I have added all the necessary permissions and while using credential I have added the user as Security admin and ediscovery manager. As for the application, I have added the compliance admin and security admin roles.