How to run this cmdlet?

Occasional Contributor

I'm trying to run the command below 


PS C:\Users\KW> New-AzureADDirectorySetting -DirectorySetting $Setting

but it gives me the following error


New-AzureADDirectorySetting : Error occurred while executing NewDirectorySetting
Code: Authorization_RequestDenied
Message: Insufficient privileges to complete the operation.
RequestId: 586c36ca-e48c-4367-a47c-dec15a6d7793
DateTimeStamp: Thu, 01 Mar 2018 15:03:42 GMT
HttpStatusCode: Forbidden
HttpStatusDescription: Forbidden
HttpResponseStatus: Completed
Au caractère Ligne:1 : 1
+ New-AzureADDirectorySetting -DirectorySetting $Setting
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [New-AzureADDirectorySetting], ApiException
+ FullyQualifiedErrorId : Microsoft.Open.MSGraphBeta.Client.ApiException,Microsoft.Open.MSGraphBeta.PowerShell.New

Yet, I'm running powershell as an administrator.


Any ideas on what I'm doing wrong?




PS: I'm following this guide , to be able to limit users to create teams in Teams.

PS2: Please don't flag my post as a spam. I'm in dire need for help.

1 Reply
best response confirmed by Andy Kw (Occasional Contributor)

I was able to resolve this issue.


I need to be 'Global administrator' to run the command above.