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
234 stars 66 forks source link

Update-GSUser: Managers Email #288

Closed MichaelJonez closed 4 years ago

MichaelJonez commented 4 years ago

I'm creating a script that will update employee information for all users in a domain. I'm using Update-GSUser and Add-GSUserOrganization which lets me set a Department, Job Title and Location which is great, but I can't see an option to set the manager's email. Is there a way to do this using PSGSuite?

scrthq commented 4 years ago

Hey @MichaelJonez - There is indeed! It's a bit odd, since Manager is a somewhat buried field under Relations, not Organizations:

$manager = Add-GSUserRelation -Type manager -Value mymanager@domain.com
Update-GSUser -User 'michael.jonez@domain.com' -Relations $manager