A couple of months ago the AzureADPreview module was released. The first cmdlet that I experimented with was Set-AzureADUserLicense. And it didn’t work, there was no working examples and I gave up and used GraphAPI instead .

Since then the AzureADPreview has gone through a number of revisions and I’ve been messing around a little with each update. TheSet-AzureADUserLicense cmdlet has been my litmus test. Now that I have both removing and assigning Office 365 licenses working I’ll save others the pain of working it out and give a couple of working examples.

How to assign and remove user Office365 licenses using the AzureADPreview Powers ...

If like me you have been experimenting with the AzureADPreview module you’ll need to force the install of the newest one. And for whatever reason I was getting an error informing me that it wasn’t signed. As I’m messing around in my dev sandpit I skipped the publisher check.

Install-Module -Name AzureADPreview -MinimumVersion -Force -SkipPublisherCheck

Import-Module AzureADPreview RequiredVersion 2.0 . 0.7 Removing an Office 365 License from a User

Removing a license with Set-AzureADUserLicenselooks something like this.

What if there are multiple licenses ? Similar concept but just looping through each one to remove.

Assigningan Office 365 License to a User

Now that we have the removal of licenses sorted, how about adding licenses ?

Assigninga license with Set-AzureADUserLicenselooks something like this;

本文系统(windows)相关术语:三级网络技术 计算机三级网络技术 网络技术基础 计算机网络技术

主题: ADPOfficeDU
本文标题:How to assign and remove user Office365 licenses using the AzureADPreview Powers ...

技术大类 技术大类 | 系统(windows) | 评论(0) | 阅读(14)