Friday, November 30, 2018

PowerShell Script to get list of Office 365 Groups

PowerShell script to get list of Office 365 Groups within your Tenant

$creds = Get-Credential
Write-Host "--- Connecting to Exchange Online Service"
$ExchOnlineSession= New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $Creds -Authentication Basic -AllowRedirection
Import-PSSession $ExchOnlineSession
write-host "--- Exchange Session Imported successfully"
Get-UnifiedGroup | Select-Object DisplayName,ManagedBy,AccessType | Export-Csv -Path "Office365Groups.csv"

You must be a Office 365 global administrator to run the cmdlet.

The Get-Credential cmdlet creates a credential object for a specified user name and password.
The New-PSSession cmdlet creates a PowerShell session (PSSession) on a local or remote computer.
The Get-UnifiedGroup cmdlet to view Office 365 Groups in your cloud-based organization. To view members, owners and subscribers for Office 365 Groups

PowerShell Script to update Site Collection Storage Quota

PowerShell Script to update SharePoint Online Site Collection Storage Quota

The Connect-SPOService cmdlet connects a SharePoint Online global administrator to the SharePoint Online Administration Center.

You must be a SharePoint Online global administrator and a site collection administrator to run the cmdlet.

Connect-SPOService -Url https://yourcompanyname-admin.sharepoint.com -credential admin@yourcompanyname.com

The Set-SPOSite cmdlet sets or updates one or more properties' values for a site collection.

Set-SPOSite -Identity https://yourcompanyname.sharepoint.com/sites/TestSiteCollection -ResourceQuota 300 -StorageQuota 10000

updates the settings of site collection https://yourcompanyname.sharepoint.com/sites/TestSiteCollection The storage quota is updated to 10000 megabytes and the resource quota is updated to 300 megabytes.