SOLVED

How to run this cmdlet?

%3CLINGO-SUB%20id%3D%22lingo-sub-166759%22%20slang%3D%22en-US%22%3EHow%20to%20run%20this%20cmdlet%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-166759%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20trying%20to%20run%20the%20command%20below%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3EPS%20C%3A%5CUsers%5CKW%26gt%3B%20New-AzureADDirectorySetting%20-DirectorySetting%20%24Setting%3C%2FPRE%3E%0A%3CP%3Ebut%20it%20gives%20me%20the%20following%20error%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3ENew-AzureADDirectorySetting%20%3A%20Error%20occurred%20while%20executing%20NewDirectorySetting%0ACode%3A%20Authorization_RequestDenied%0AMessage%3A%20Insufficient%20privileges%20to%20complete%20the%20operation.%0AInnerError%3A%0ARequestId%3A%20586c36ca-e48c-4367-a47c-dec15a6d7793%0ADateTimeStamp%3A%20Thu%2C%2001%20Mar%202018%2015%3A03%3A42%20GMT%0AHttpStatusCode%3A%20Forbidden%0AHttpStatusDescription%3A%20Forbidden%0AHttpResponseStatus%3A%20Completed%0AAu%20caract%C3%A8re%20Ligne%3A1%20%3A%201%0A%2B%20New-AzureADDirectorySetting%20-DirectorySetting%20%24Setting%0A%2B%20~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%0A%2B%20CategoryInfo%20%3A%20NotSpecified%3A%20(%3A)%20%5BNew-AzureADDirectorySetting%5D%2C%20ApiException%0A%2B%20FullyQualifiedErrorId%20%3A%20Microsoft.Open.MSGraphBeta.Client.ApiException%2CMicrosoft.Open.MSGraphBeta.PowerShell.New%0ADirectorySetting%3C%2FPRE%3E%0A%3CP%3EYet%2C%20I'm%20running%20powershell%20as%20an%20administrator.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAny%20ideas%20on%20what%20I'm%20doing%20wrong%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECheers.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPS%3A%20I'm%20following%20this%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fsupport.office.com%2Fen-us%2Farticle%2FManage-who-can-create-Office-365-Groups-4c46c8cb-17d0-44b5-9776-005fced8e618%3Fui%3Den-US%26amp%3Brs%3Den-US%26amp%3Bad%3DUS%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Eguide%3C%2FA%3E%26nbsp%3B%2C%20to%20be%20able%20to%20limit%20users%20to%20create%20teams%20in%20Teams.%3CBR%20%2F%3E%3CBR%20%2F%3EPS2%3A%20Please%20don't%20flag%20my%20post%20as%20a%20spam.%20I'm%20in%20dire%20need%20for%20help.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-166759%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20AD%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPowerShell%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ETeams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-166811%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20run%20this%20cmdlet%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-166811%22%20slang%3D%22en-US%22%3E%3CP%3EI%20was%20able%20to%20resolve%20this%20issue.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20need%20to%20be%20'Global%20administrator'%20to%20run%20the%20command%20above.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECheers.%3C%2FP%3E%3C%2FLINGO-BODY%3E
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.
InnerError:
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
DirectorySetting

Yet, I'm running powershell as an administrator.

 

Any ideas on what I'm doing wrong?

 

Cheers.

 

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)
Solution

I was able to resolve this issue.

 

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

 

Cheers.