Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Input credential
- $adminUPN="<user>@<tenant>.onmicrosoft.com"
- $userCredential = Get-Credential -UserName $adminUPN -Message "Type the password."
- # Connect to SharePoint Online Admin Center
- Connect-SPOService -Url https://<tenant>-admin.sharepoint.com/ -Credential $userCredential
- # Get all site collections
- $sites = Get-SPOSite -Limit All
- # Iterate the site collections
- foreach ($site in $sites) {
- Write-Host "Title: "$site.Title
- Write-Host "Url: "$site.Url
- Write-Host "-------------------------"
- }
Add Comment
Please, Sign In to add comment