简体   繁体   English

Powershell - 在保留现有应用程序的同时迁移 Office 365 许可产品

[英]Powershell - Migrate Office 365 licensed products while retaining existing apps

Our users are not granted access to all the apps for their licensed products in Office 365. This is by design, and we would like to keep it that way.我们的用户无权访问 Office 365 中其许可产品的所有应用程序。这是设计使然,我们希望保持这种方式。

Soon we will be migrating licensed products (eg Business Basic -> E3).很快我们将迁移许可产品(例如 Business Basic -> E3)。 I would like to automate this as much as possible.我想尽可能地自动化这个。

Step 1 is to retrieve the exact list of "apps" a user is assigned/enabled in O365 and temporarily store it.第 1 步是检索用户在 O365 中分配/启用的“应用程序”的确切列表并临时存储它。

Step 2 is to add the new license to that user.第 2 步是将新许可证添加到该用户。

Step 3 is to remove the old license from that user.第 3 步是从该用户删除旧许可证。

Step 4 is to restore the "apps" a from step 1, so that they have the same apps they started with.第 4 步是从第 1 步恢复“应用程序”a,以便它们具有与开始时相同的应用程序。 No more, no less.不多也不少。

I'm stuck at Step 1. I'm not finding an AzureAD powershell command to do this.我被困在第 1 步。我找不到执行此操作的 AzureAD powershell 命令。

For Step 2 & 3, Get-AzureADUserLicenseDetail and its related commands look very promising.对于第 2 步和第 3 步,Get-AzureADUserLicenseDetail 及其相关命令看起来很有希望。

Anyone able to point me in the right direction?谁能指出我正确的方向?

Thanks!谢谢!

Step 1 can also be finished by Get-AzureADUserLicenseDetail .步骤 1 也可以通过Get-AzureADUserLicenseDetail完成。

#List the SKUs assigned to a user
$licenses = Get-AzureADUserLicenseDetail -ObjectId test@domain.onmicrosoft.com

#the first SKU is O365 E5 in my case. List its licenses (service plans)
Write-Host $licenses[0].ServicePlans

It's like this:就像这样:

在此处输入图像描述

If the "apps" are assigned to the user successfully, the "ProvisioningStatus" is "Success".如果“apps”成功分配给用户,“ProvisioningStatus”为“Success”。

You can judge whether the app is assigned successfully based on this.您可以根据此判断应用是否分配成功。

Step 2 and 3 can be done with Set-AzureADUserLicense .步骤 2 和 3 可以使用Set-AzureADUserLicense完成。

You may need the help of this cmd: Get-AzureADSubscribedSku , which can list all the subscriptions (and the service plans under each subscription).您可能需要这个 cmd 的帮助: Get-AzureADSubscribedSku ,它可以列出所有订阅(以及每个订阅下的服务计划)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM