SCRT-HQ / PSGSuite

Powershell module for Google / G Suite API calls wrapped in handy functions. Authentication is established using a service account via P12 key to negate the consent popup and allow for greater handsoff automation capabilities
https://psgsuite.io/
Apache License 2.0
235 stars 67 forks source link

New-GSuser Permissions issue #191

Closed Chris4678 closed 5 years ago

Chris4678 commented 5 years ago

Whenever I try to create a new user using New-GSUser it gives me an error: Not Authorized to access this resource/api [403]

This is strange to me because I used a Super Admin account and followed all of the initial setup instructions to a t. I am able to use New-GSOrganizationalUnit just fine as well as other OU related commands. I just now got to the part of my script where I am adding users and have hit a brick wall here. I cant figure out why it thinks I dont have access to the API. I enabled everything just like I was told to. How can I troubleshoot this farther?

Here is the exact command I am trying to run as a test: New-GSUser -PrimaryEmail "email@email.com" -GivenName "billy" -FamilyName "bob" -Password (ConvertTo-SecureString -String 'Password1!' -AsPlainText -Force) -ChangePasswordAtNextLogin

Chris4678 commented 5 years ago

Also if it helps I just tested and I am able to update a user with Update-GSUser just fine. Its only New-GSUser thats giving me an error.

Chris4678 commented 5 years ago

I am stupid. If anyone else gets this error its because the domain for the email address you are assigning them has to be your own...