![]() ![]() Once the script is run, Azure AD should sync with AD and the group members will no longer have the license. In our case we used, "lic_MsBizCtner" and only took away one license: "ConcurrencyInc:MICROSOFT_BUSINESS_CENTER". Then the last part of the script is removing one or multiple licenses from the UPNs of a selected group. csv file gives sam account name as first initial last name and the user principal name should have our domain at the end, so the "foreach" command is setting to the end of each sam account name. The first part of this script is connecting to Microsoft online services then getting the group member information from AD, in our case we are getting information from "lic_MsBizCtner", selecting the sam account name, then putting that information into a. How do we automatically remove for the GAL listings the users that no longer have licensing (therefore dont have an available mailbox) and are also disabled Vote 1 comment Best Add a Comment Timoth圓03 2 min. The above script is loosely based on the following sytnax from Microsoft. We remove the Office365 license and disable the account, but the users still show in the GAL. $UPN = $SAM -UserPrincipalName $UPN -RemoveLicenses "ConcurrencyInc:MICROSOFT_BUSINESS_CENTER" $CSVValues = Import-Csv "C:\users\$env:UserName\desktop\License\license.csv" ![]() Get-ADGroupMember -identity “lic_MsBizCtnr” | select samaccountname | Export-csv -path C:\users\$env:UserName\Desktop\License\License.csv -NoTypeInformation Now that we have the licenses our organization uses we can run the next script that will remove licenses from a group in AAD. The SkuID's can be a little confusing to read too so look at. ![]() csv file by using:Įxport-Csv -path C:\users\$env:UserName\Desktop\SKU.csv -NoTypeInformation To make things easier to view we can have the script spit out the results in a. The first script that should be run will allow us to view our organizations licenses. The below scripting process was done with the help of Ryan Gorski, a systems administrator for our corporate IT team.
0 Comments
Leave a Reply. |