Office 365:如何批量初始化OneDrive for Business?

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Office 365:如何批量初始化OneDrive for Business?相关的知识,希望对你有一定的参考价值。

很多公司在使用Office 365之后,根据企业内部的业务需求,需要将Office 365 订阅下的部分用户(Mailbox+OneDrive for Business+ SharePoint Site Collection)迁移到新订阅中进行管理,那么在Tenant to Tenant迁移时,管理员在新订阅中添加或者同步用户并授权之后,针对OneDrive for Business需要做的是如何批量初始化OneDrive for Business,而不是手动一个个登录账户再通过单击“OneDrive for Business”来完成初始化过程,具体分两个过程:

  • 使用PowerShell命令批量初始化OneDrive for Business
  • 使用PowerShell命令验证初始化OneDrive for Business 成功

使用PowerShell命令批量初始化OneDrive for Business

本文将为大家介绍如何使用Powershell的方式完成批量初始化OneDrive for Business的操作步骤,具体操作步骤如下所示:

  1. 安装Windows Azure Active Directory Module for Windows PowerShell,获取Office 365 全局管理员的登录身份:

    Import-Module MSOnline
    $msolCred = Get-Credential

    技术图片

2.使用获取到的用户身份链接SharePoint Online Service:
Connect-MsolService -credential $msolCred
Connect-SPOService -url https://mvptraining-admin.sharepoint.com -Credential $msolCred

技术图片
3.输入要请求OneDrive for business初始化的UPN地址:
$emails = "[email protected]","neilding[email protected]"
技术图片

4.请求批量生成Personal Site的命令:

request-SPOPersonalSite -UserEmails $emails -nowait

技术图片

说明:

1.Request-SPOPersonalSite cmdlet请求将指定的用户加入队列,以便为每个用户创建一个个人站点,实际的个人站点稍后由Timer job来创建,批量初始化OneDrive将在24小时内生效。。
2.该命令一次最多可以指定200个用户批量初始化OneDrive for Business
3.执行此cmdlet的用户必须至少分配SharePoint Online Administrator角色,并已分配SharePoint Online License,以便能够为用户提供OneDrive。

使用PowerShell命令验证初始化OneDrive for Business 成功

1.Get-SPOSite?-Template?"SPSPERS"?-limit?ALL?-includepersonalsite?$True?|?Select?URL,?Owner?|?Format-table?-autosize?|?Out-string?-width?8096?|?Out-file?C:\OneDriveSites.txt

技术图片

2.批量初始化的OneDrive已生成,Report如下所示:

技术图片

谢谢阅读~

以上是关于Office 365:如何批量初始化OneDrive for Business?的主要内容,如果未能解决你的问题,请参考以下文章

office 365通过PowerShell批量添加共享邮箱成员

Office 365 系列之六:通过管理中心批量导入用户

Office 365批量创建用户以及消除用户信息乱码的方法

powershell 批量获取office365用户邮箱使用容量

Office 365 系列之七:安装 Office 365 ProPlus

在Office 365 添加就地保留用户邮箱