Connect to Office 365 Security & Compliance Center through Powershell

238 views Asked by At

We're having some connection issues with the Office 365 Security & Compliance Center when Office 365 connects to any SSO service like Okta. We have already implemented Basic Authentication via PowerShell using the following documentation. But in the case when the user is authenticated through SSO, errors occur(the user with the same email address may not exist in the O365), for example:

(In the case of a Federated user(that is owned by a federated IdP, as opposed to a managed user owned in an Azure AD tenant) ID3242: The security token could not be authenticated or authorized.The user does not exist or has entered the wrong passwordInnerException : Object reference not set to an instance of an object.) AND at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)

Can you provide some information about other authentication options in the Office 365 Security & Compliance Center (for example, App-only authentication, but it is not supported in the Compliance Center) or how we can get authentication from using single sign-on?

1

There are 1 answers

0
nikkelly On

If your SSO is configured correctly and you don't notice any other issues with it you may need an interactive session, which is the case when MFA is enforced in my tenant.

$Creds = (Get-Credential)
Connect-IPPSSession -UserPrincipalName $creds.Username