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

G Suite Business - Archived User #252

Closed blocconl closed 4 years ago

blocconl commented 4 years ago

Is your feature request related to a problem? Please describe. We would like to Get/Remove/Set/Update the 'G Suite Business - Archived User' license.

Describe the solution you'd like We would like to use this feature in PSGSuite

Describe alternatives you've considered I have seen that GAM supports this license.

Additional context ProductId : 101034 ProductName : G Suite Archived User SkuId : 1010340002 SkuName : G Suite Business - Archived User

blocconl commented 4 years ago

Never mind, found the solution.

Added this code bellow to the param set of Update-GSUser. This worked for me.

[parameter(Mandatory = $false)]
[Switch]
$Archived,
scrthq commented 4 years ago

hey @blocconl - Thanks for opening this up! So this is a license switch completely, I take it? First I've seen that license type tbh, but Google's added a few things over time. If that's all that is needed to get the license switched over, I'll work on adding that to the actual code base for the next release

blocconl commented 4 years ago

Hey @scrthq, Yes this is a license to reduce costs while waiting for account deletion, you can switch this license to activate / deactivate it.

Would be nice if the 'Archived User' license could be added to Get-GSUserLicense so you have a overview of 'Archived Users'.

Thanks!

scrthq commented 4 years ago

hey @blocconl - so it looks like Archived User licenses might not be in the standard license type (not finding it under the Product and SKU list at least).

I don't have any Archived User licenses purchased for any of my domains; do you get anything back at all when trying Get-GSUserLicense against a user with an AU license assigned? If so, what is the Product ID and SKU ID listed?

This might be similar to Cloud Identity Free licenses in that they aren't visible through the License API, seeing what I can do though

scrthq commented 4 years ago

@blocconl - the $Archived parameter has been added in as of v2.35.0. As it stands, I don't see a documented way to get Archived User license information, so I'll wait for your test results / response to my last comment before closing this out.

blocconl commented 4 years ago

@blocconl - the $Archived parameter has been added in as of v2.35.0. As it stands, I don't see a documented way to get Archived User license information, so I'll wait for your test results / response to my last comment before closing this out.

@scrthq - I have tested the $Archived parameter, and it's works great! Thank you.

I added the Product ID and SKU ID for 'archived users' to Get-GSUserLicense when i call a user than i get the license back.

ProductId : 101034 SkuId : 1010340002

scrthq commented 4 years ago

Awesome!!! Thank you for sending those product and SKU IDs!! I'll get those added in to the *License functions ASAP. Although not officially documented, looks like GAM-X has the full list (or at least a more complete one) with a few others not documented as well: https://github.com/taers232c/GAMADV-X/blob/2da360608a13a4142c57b3416b737fa6291565e5/src/gamlib/glskus.py