This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# source : http://www.thatlazyadmin.com/create-new-microsoft-team-using-powershell/ | |
Connect-MicrosoftTeams | |
New-Team -DisplayName "That Lazy Admin Moderators" -Visibility Private |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Sharepoint Online - Site hub management | |
//Please connect first with - PS> Connect-SPOService -url https://<your tenant>-admin.sharepoint.com | |
#Export all admin users and roles to CSV | |
Get-MsolRole | %{$role = $_.name; Get-MsolRoleMember -RoleObjectId $_.objectid} | select @{Name="Role"; Expression = {$role}}, DisplayName, EmailAddress | Export-Csv .\tenantadminrole.csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#install properly module, not updating existing modules | |
Install-module -name hawk -AllowClobber |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import Office 365 Online Module | |
Import-module MSOnline | |
#Get admin credential | |
$UserCredential = Get-Credential | |
#start session | |
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection | |
#connect to msonline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Sharepoint Online - Site hub management | |
//Please connect first with - PS> Connect-SPOService -url https://<your tenant>-admin.sharepoint.com | |
//Get all sites containing url sites/mkt | |
Get-SPOSite -limit all | select url,ID | where-object {$_.Url -like "*sites/mkt*"} | |
//Remove a site from the recycle bin | |
Remove-SPODeletedSite -Identity https://contoso.sharepoint.com/sites/sitetoremove | |
//Register a site as Site Hub - principals should be default admin group |