Comments on: Microsoft 365 License Management for User Accounts with the Microsoft Graph PowerShell SDK https://practical365.com/microsoft-365-license-graph-sdk/ Practical Office 365 News, Tips, and Tutorials Thu, 25 Apr 2024 17:54:53 +0000 hourly 1 https://wordpress.org/?v=6.6.1 By: Rob https://practical365.com/microsoft-365-license-graph-sdk/#comment-292977 Thu, 25 Apr 2024 17:54:53 +0000 https://practical365.com/?p=55954#comment-292977 Thank you for your examples, Tony. I am trying to find the best way to export SKU, UPN, Display Name, and Department to one CSV file, but no amount of manipulation gives me the right results. Do you know of the best method to achieve this?

]]>
By: <div class="apbct-real-user-wrapper"> <div class="apbct-real-user-author-name">Tony Redmond</div> <div class="apbct-real-user-badge" onmouseover=" let popup = document.getElementById('apbct_trp_comment_id_290878'); popup.style.display = 'inline-flex'; "> <div class="apbct-real-user-popup" id="apbct_trp_comment_id_290878"> <div class="apbct-real-user-title"> <p class="apbct-real-user-popup-header">The Real Person!</p> <p class="apbct-real-user-popup-text">Author <b>Tony Redmond</b> acts as a real person and passed all tests against spambots. Anti-Spam by CleanTalk.</p> </div> </div> </div> </div> https://practical365.com/microsoft-365-license-graph-sdk/#comment-290878 Mon, 25 Mar 2024 10:58:10 +0000 https://practical365.com/?p=55954#comment-290878 In reply to Paul Karanja.

When you run Set-MgUserLicense to disable service plans for a license, you pass two values in a hash table to the AddLicenses parameter. One is the product (SKU) id for the license, the other is an array of disabled service plans. To reenable a service plan, run Set-MgUserLicense again after removing its service plan identifier from the array of disabled service plans. All explained in detail in the Office 365 for IT Pros eBook (;-)

]]>
By: Paul Karanja https://practical365.com/microsoft-365-license-graph-sdk/#comment-290861 Mon, 25 Mar 2024 03:24:40 +0000 https://practical365.com/?p=55954#comment-290861 Hi Tony,

I have seen a lot of examples of how to assign skus and disable service plans, I am yet to see an example on how to enable disabled service plans. I can’t seem to get the right syntax for it.

]]>
By: Preston H. https://practical365.com/microsoft-365-license-graph-sdk/#comment-289766 Fri, 08 Mar 2024 19:20:24 +0000 https://practical365.com/?p=55954#comment-289766 In reply to Tony Redmond.

I appreciate the help!

]]>
By: <div class="apbct-real-user-wrapper"> <div class="apbct-real-user-author-name">Tony Redmond</div> <div class="apbct-real-user-badge" onmouseover=" let popup = document.getElementById('apbct_trp_comment_id_289763'); popup.style.display = 'inline-flex'; "> <div class="apbct-real-user-popup" id="apbct_trp_comment_id_289763"> <div class="apbct-real-user-title"> <p class="apbct-real-user-popup-header">The Real Person!</p> <p class="apbct-real-user-popup-text">Author <b>Tony Redmond</b> acts as a real person and passed all tests against spambots. Anti-Spam by CleanTalk.</p> </div> </div> </div> </div> https://practical365.com/microsoft-365-license-graph-sdk/#comment-289763 Fri, 08 Mar 2024 18:49:22 +0000 https://practical365.com/?p=55954#comment-289763 In reply to Preston H..

Whatever works… works… that’s the beauty of PowerShell.

]]>
By: Preston H. https://practical365.com/microsoft-365-license-graph-sdk/#comment-289757 Fri, 08 Mar 2024 17:42:47 +0000 https://practical365.com/?p=55954#comment-289757 In reply to Tony Redmond.

I am working on that now! This is a script I wrote that pulls the userid’s from a CSV file. I did it this way because I can run a report to show who has the E3 and the Exchange Online Plan 2 license, and I know for certain I am pulling an EP2 license away from an E3. You just put the userid’s in the CSV file, with the first line being called UserId, and all the lines below are the UPN’s of the users that you want to remove the license from. Not as complex of a script like yours but hey it works!

$users= Import-Csv “C:\temp\userlist.csv”
$ep2Sku = Get-MgSubscribedSku -All | Where SkuPartNumber -eq ‘EXCHANGEENTERPRISE’
foreach ($user in $users)
{
Set-MgUserLicense -UserId $user.userid -RemoveLicenses $ep2Sku.SkuId -AddLicenses @()
}

]]>
By: Tony Redmond https://practical365.com/microsoft-365-license-graph-sdk/#comment-289751 Fri, 08 Mar 2024 17:15:55 +0000 https://practical365.com/?p=55954#comment-289751 In reply to Preston H..

Did you get your licenses reassigned?

]]>
By: Tony Redmond https://practical365.com/microsoft-365-license-graph-sdk/#comment-289557 Tue, 05 Mar 2024 21:34:35 +0000 https://practical365.com/?p=55954#comment-289557 In reply to Preston H..

I remembered that I wrote this article https://practical365.com/switch-microsoft-365-licenses/ about approximately the same situation. Perhaps it will help.

]]>
By: Preston H. https://practical365.com/microsoft-365-license-graph-sdk/#comment-289556 Tue, 05 Mar 2024 21:17:08 +0000 https://practical365.com/?p=55954#comment-289556 In reply to Tony Redmond.

I will see if I can figure out how to write this. hopefully with some whatif statements! Thanks!

]]>
By: <div class="apbct-real-user-wrapper"> <div class="apbct-real-user-author-name">Tony Redmond</div> <div class="apbct-real-user-badge" onmouseover=" let popup = document.getElementById('apbct_trp_comment_id_289553'); popup.style.display = 'inline-flex'; "> <div class="apbct-real-user-popup" id="apbct_trp_comment_id_289553"> <div class="apbct-real-user-title"> <p class="apbct-real-user-popup-header">The Real Person!</p> <p class="apbct-real-user-popup-text">Author <b>Tony Redmond</b> acts as a real person and passed all tests against spambots. Anti-Spam by CleanTalk.</p> </div> </div> </div> </div> https://practical365.com/microsoft-365-license-graph-sdk/#comment-289553 Tue, 05 Mar 2024 20:36:25 +0000 https://practical365.com/?p=55954#comment-289553 In reply to Tony Redmond.

And I am literally running out of the house to the airport else I would write the code… But it is simple enough. You might want to add some logging etc. to track the removals of the licenses. Remember to stop paying Microsoft for the Exchange Online P2 licenses!

]]>