Skip to content
This repository was archived by the owner on Jun 17, 2024. It is now read-only.

Tenant Admin Powershell Cmdlets trigger the creation of OneDrive for Business sites and grant tenant administrators administrative access to these sites.

License

Notifications You must be signed in to change notification settings

OneNoteDev/OneDriveForBusiness-SetupPowerShellCmdlets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 

Repository files navigation

OneDrive for Business Setup Powershell Cmdlets

Created by Microsoft Corporation, 2016. Provided as-is without warranty. Trademarks mentioned here are the property of their owners.

Tenant Admin Powershell Cmdlets to trigger the creation of OneDrive for Business sites and grant tenant administrators administrative access to these sites.

Prerequisites

Before you begin running the Scripts, review the following information about prerequisites:

Also verify the following:

  • The tenant admin is a Global Administrator in Office 365 for enterprises.
  • The tenant admin is a member of the Administrators group on the server on which you are running the Windows PowerShell script.

PreSetupOdbSites.ps1

The PowerShell script contains the following cmdlets that can be made available by loading the script

. C:\powershell\PreSetupOdbSites.ps1

The cmdlets are as follows:

1- Add-UsersForOdbSitesCreation cmdlet

Add users for OneDrive for Business site creation.

2- Grant-TenantAdminPermissionsToOdbSites cmdlet
    
Grants the tenant administrators administrative permissions to the OneDrive for Business sites.

Add-UsersForOdbSitesCreation cmdlet

Add-UsersForOdbSitesCreation cmdlet can be used to trigger the creation of users' OneDrive for Business sites. The users’ emails need to be separated by commas. You can pass in a maximum of 200 users. The creation can take up to one day to complete.

Example:

Add-UsersForOdbSitesCreation -userName "admin@contoso.onmicrosoft.com" -password "December2015" -adminSiteUrl "https://contoso-admin.sharepoint.com" -userIds "user1@contoso.onmicrosoft.com,user2@contoso.onmicrosoft.com"

Output:

Hash table with Status and the Failures of users' emails separated by commas

    Name                           Value                                                                                                                                                                                                                             
    ----                           -----                                                                                                                                                                                                                             
    Failures                                                                                                                                                                                                                                                         
    Status                         Add-UsersForOdbSitesCreation finished executing. Failures: [0]  

Grant-TenantAdminPermissionsToOdbSites

Grant-TenantAdminPermissionsToOdbSites cmdlet grants the Tenant Admin administrative permissions to the users' OneDrive for Business sites. The users’ emails need to be separated by commas. You can pass in a maximum of 200 users.

Example:

Grant-TenantAdminPermissionsToOdbSites -userName "admin@contoso.onmicrosoft.com" -password "December2015" -adminSiteUrl "https://contoso-admin.sharepoint.com" -userIds "user1@contoso.onmicrosoft.com,user2@contoso.onmicrosoft.com"

Output:

Hash table with Status and the Failures of users' emails separated by commas

    Name                           Value                                                                                                                                                                                                                             
    ----                           -----                                                                                                                                                                                                                             
    Failures                                                                                                                                                                                                                                                         
    Status                         Granting Tenant Admin Permissions To Odb Sites finished executing. Failures: [0]

Version info

This is the initial public release for this code sample.

About

Tenant Admin Powershell Cmdlets trigger the creation of OneDrive for Business sites and grant tenant administrators administrative access to these sites.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published