Get-AzureADDirectorySetting - Authintication problems

Sean VanderWier 1 Reputation point
2021-06-04T18:44:00.057+00:00

So I am trying to configure Sensitivity labels according to the documentation here - https://learn.microsoft.com/en-us/azure/active-directory/enterprise-users/groups-assign-sensitivity-labels

I currently am using a M365 GCC High tenant and according the the roadmap sensitivity labels are rolled out.

Following the directions it asked me to connect to Azure-AD and run this command - $Setting = Get-AzureADDirectorySetting -Id (Get-AzureADDirectorySetting | where -Property DisplayName -Value "Group.Unified" -EQ).id

I log in find but when I try and run the command I get the following error -
Get-AzureADDirectorySetting : Error occurred while executing GetDirectorySettings
Code: InvalidAuthenticationToken
Message: Access token validation failure. Invalid audience.
InnerError:
RequestId: 88c2acdd........
DateTimeStamp: Fri, 04 Jun 2021 18:07:50 GMT
HttpStatusCode: Unauthorized
HttpStatusDescription: Unauthorized
HttpResponseStatus: Completed
........

Microsoft Security | Microsoft Entra | Microsoft Entra ID
{count} votes

3 answers

Sort by: Most helpful
  1. Marilee Turscak-MSFT 37,206 Reputation points Microsoft Employee Moderator
    2021-06-04T20:09:19.913+00:00

    You need to ensure that your app is registered and the correct permissions are assigned.

    Also, please make sure that your resource is set correctly.

    If all of that is correct there might be a conditional access policy in place that is blocking the authorization.


  2. Bill Mitchell 1 Reputation point
    2021-06-21T22:24:44.487+00:00

    Instead of "Connect-AzureAD", use "Connect-AzureAD -AzureEnvironmentName AzureUSGovernment"

    This solved my issue.

    0 comments No comments

  3. IT4045 1 Reputation point
    2021-06-22T00:28:07.607+00:00

    That did the trick. Thanks!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.