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

SuspensionReason of Get-GSUser does not list 'Automatically Suspended' #208

Closed BarnumD closed 5 years ago

BarnumD commented 5 years ago

Describe the bug Perhaps this is an issue on Google's side and not PSGSuite, but I have a user that was 'Automatically Suspended' by google (see image below) due to suspicious account activity. However, when I use Get-PSUser against this account there is no information under SuspensionReason. Perhaps Google is just not putting any information into that field when they lock an account or perhaps PSGSuite could do more to get that information. I don't know. Let me know which is the case.

Expected behavior Expect SuspensionReason to include 'Automatically Suspended by Google' information.

Screenshots image

scrthq commented 5 years ago

Hey @BarnumD - Are they showing anything at all under SuspensionReason? And are they showing Suspended : True? I've honestly only ever seen ADMIN as the SuspensionReason, but I also haven't checked under the exact circumstances you're seeing as it doesn't happen all that often. At any rate, PSGSuite isn't manipulating the data returned the Directory API, so what you're seeing in PSGSuite is what Google is returning.

Here's a sample showing a working user vs suspended user:

image

BarnumD commented 5 years ago

No, SuspensionReason is completely blank. Suspended is True. So I take it that there's nothing you can do about it. What about the ability to set that SuspensionReason field from the module? Should I open a feature request for that?

scrthq commented 5 years ago

That field is actually ReadOnly/not writable on the API itself, so we're a little stuck with what Google provides here, unfortunately:

Doc Link

image

BarnumD commented 5 years ago

Thanks for the information. Very helpful. I just wish Google would have provided the reason.

scrthq commented 5 years ago

100% agreed! That field could be so much more useful 😞