天天看點

Office 365:如何批量初始化OneDrive for Business?使用PowerShell指令批量初始化OneDrive for Business使用PowerShell指令驗證初始化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的操作步驟,具體操作步驟如下所示:

安裝Windows Azure Active Directory Module for Windows PowerShell,擷取Office 365 全局管理者的登入身份:

Import-Module MSOnline

$msolCred = Get-Credential

Office 365:如何批量初始化OneDrive for Business?使用PowerShell指令批量初始化OneDrive for Business使用PowerShell指令驗證初始化OneDrive for Business 成功

2.使用擷取到的使用者身份連結SharePoint Online Service:

Connect-MsolService -credential $msolCred

Connect-SPOService -url https://mvptraining-admin.sharepoint.com -Credential $msolCred

Office 365:如何批量初始化OneDrive for Business?使用PowerShell指令批量初始化OneDrive for Business使用PowerShell指令驗證初始化OneDrive for Business 成功

3.輸入要請求OneDrive for business初始化的UPN位址:

$emails = "[email protected]","[email protected]"

Office 365:如何批量初始化OneDrive for Business?使用PowerShell指令批量初始化OneDrive for Business使用PowerShell指令驗證初始化OneDrive for Business 成功

4.請求批量生成Personal Site的指令:

request-SPOPersonalSite -UserEmails $emails -nowait

Office 365:如何批量初始化OneDrive for Business?使用PowerShell指令批量初始化OneDrive for Business使用PowerShell指令驗證初始化OneDrive for Business 成功

說明:

1.Request-SPOPersonalSite cmdlet請求将指定的使用者加入隊列,以便為每個使用者建立一個個人站點,實際的個人站點稍後由Timer job來建立,批量初始化OneDrive将在24小時内生效。。

2.該指令一次最多可以指定200個使用者批量初始化OneDrive for Business

3.執行此cmdlet的使用者必須至少配置設定SharePoint Online Administrator角色,并已配置設定SharePoint Online License,以便能夠為使用者提供OneDrive。

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

Office 365:如何批量初始化OneDrive for Business?使用PowerShell指令批量初始化OneDrive for Business使用PowerShell指令驗證初始化OneDrive for Business 成功

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

Office 365:如何批量初始化OneDrive for Business?使用PowerShell指令批量初始化OneDrive for Business使用PowerShell指令驗證初始化OneDrive for Business 成功

謝謝閱讀~

繼續閱讀