Created
June 26, 2021 12:46
-
-
Save ramiroencinas/ab07f9586077dbd698460b09fb77166d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Get Office 365 License Names from GUID | |
| function Get-LicenseNamesByGUID { | |
| param( [string] $GUID ) | |
| [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 | |
| $wc = New-Object System.Net.WebClient | |
| $wc.Encoding = [System.Text.Encoding]::UTF8 | |
| $src = $wc.downloadstring('https://docs.microsoft.com/en-us/azure/active-directory/enterprise-users/licensing-service-plan-reference') | |
| if ( $src -match "<tr>\n<td>(.*?)</td>\n<td>(.*?)</td>\n<td>$GUID</td>") { | |
| return [pscustomobject]@{ | |
| ProductName = $matches[1] | |
| StringID = $matches[2] | |
| } | |
| } | |
| } | |
| # Example for OFFICE 365 E1 (STANDARDPACK) | |
| Get-LicenseNamesByGUID -GUID '18181a46-0d4e-45cd-891e-60aabd171b4e' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment