-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get-GSUserLicense doesnt show all licenses #270
Comments
@pompushko - For the target user, what licenses do they have assigned to them in the Admin console? In your description, you mention Google-Vault and Google-Apps licenses, but you can't have both a Vault license and a Google-Apps license on the same user. I'm not aware of any situations where multiple licenses can be attached to a single user so I might be missing something, but your example makes sense in that those 2 license types would definitely conflict with each other.
You can alternatively do something like this to find all licenses attached to a specific user: Get-GSUserLicense -Verbose | Where-Object {$_.UserId -eq $user} If you wanted to handle removing just the first license found only, you could just do the below with the current behavior since
# Current
Get-GSUserLicense -User $user | Remove-GSUserLicense -User $user
# Future
Get-GSUserLicense -User $user | Remove-GSUserLicense |
Weird, this is the first time I've seen both Vault and Basic licenses assigned, but I guess that's because it's normal Vault, not Vault-Former-Employee. Noted! Taking this as a feature request. |
Yeah, but when you assign Vault-Former-Employee - script throw error with something like "same product assigned" I can post you this later |
Yes, |
Working on adding that switch parameter to |
## 2.36.3 - 2020-03-20 * [Issue #270](#270) * Added `CheckAll` switch parameter to `Get-GSUserLicense` * Updated `User` parameter aliases for all `*-GSUserLicense` functions to include `UserId` for better pipeline support. * Miscellaneous * Updated GitHub Release section in psake.ps1 to POST the release to the Org URL due to failures.
## 2.36.3 - 2020-03-20 * [Issue #270](#270) * Added `CheckAll` switch parameter to `Get-GSUserLicense` * Updated `User` parameter aliases for all `*-GSUserLicense` functions to include `UserId` for better pipeline support. * Miscellaneous * Updated GitHub Release section in psake.ps1 to POST the release to the Org URL due to failures.
hey @pompushko - I've just released an update to accommodate the request to get all licenses for a user in version 2.36.3. Update when you can! To get all licenses for a user, just pass the Get-GSUserLicense -User $user -CheckAll Also, you should now be able to simply pipe the output of # Remove the first license matched only
Get-GSUserLicense -User $user | Remove-GSUserLicense
# Remove all licenses
Get-GSUserLicense -User $user -CheckAll | Remove-GSUserLicense
# Remove just a specific license type
Get-GSUserLicense -User $user -License Google-Vault | Remove-GSUserLicense |
Tested. PSGsuite updated up to 2.35.3, it show 2 licenses(assigned to user) and after that show line "WARNING: No license found for USER!" |
Ahhhhh, I know why that is. I'll get a new version out today, I'm glad you're getting both licenses back now though 🙂 |
Alright, version 2.36.4 is out and you should be good to go now @pompushko |
Yeah. All working fine now :D |
Thhis seems still not fixed. I am on version 2.36.4 which seems to be the last one and when I run Get-GSUserLicense -User "username" I don´t get any licenses back. Even though when I run the commandlet whithout options I can see that this user got licenses in the list of all users... |
I believe this is because this module hasn't been updated in some time, and doesn't account for the new license changes in Google Workspace. I'm not sure exactly how this works, but I presume all of the license types at the time of the last update are hard coded into this module. If you try something like this
It's a shame but this module is unfortunately getting less and less useful the more out of date it becomes :( |
I'm working on updating the licences to match the Google Dev documentation but noticed that even if you run This appears to be caused by this section of code: If the checkall param wasn't set, and an API response was received, then set the matchedLicence variable to true, then break. Nothing here is returning the results to the terminal. My licence change will also fix this issue by returning the results to terminal. |
Describe the bug
Get-GSUserLicense
doesnt show all licensesTo Reproduce
Steps to reproduce the behavior:
Get-GSUserLicense -User USER
Get-GSUserLicense -User USER -License Google-Vault
Get-GSUserLicense -User USER -License Google-Apps-For-Business
Get-GSUserLicense -User USER | ForEach-Object { Remove-GSUserLicense -User $_.UserId -License $_.SkuId -Confirm }
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: