This file contains hidden or 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
| $tenant = "yourTenantName" | |
| $tenantAdminUrl = "https://$($tenant)-admin.sharepoint.com" | |
| Connect-SPOService $tenantAdminUrl | |
| Set-SPOTenantSyncClientRestriction -DisableReportProblemDialog $true |
This file contains hidden or 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
| ## Initializing the module | |
| $storage = "addYourStorageNameHere" | |
| $key = "addYourStorageSecretKeyHere" | |
| Import-Module AZTableModule.psm1 -ArgumentList $storage, $key | |
| ## Creating a new table | |
| New-AzTable "sampletable" | |
| ## Add a new entry to your table | |
| # - Dates must be older or equal than "1901-01-01" |
This file contains hidden or 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
| $tenantName = "putYourTenantNameHere" | |
| $adminUrl = "https://$tenantName-admin.sharepoint.com" | |
| $oneDriveRetentionPeriod = 60 | |
| Connect-SPOService $tenantName | |
| Set-SPOTenant -OrphanedPersonalSitesRetentionPeriod $oneDriveRetentionPeriod |
This file contains hidden or 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
| Add-PSSnapin Microsoft.SharePoint.Powershell -ea 0 | |
| $webUrl = "addYourUrlHere" | |
| $list = "addYourListOrLibraryNameHere" | |
| $web = get-spweb $webUrl | |
| $library = $web.Lists[$list] | |
| $library.EnableThrottling = $false | |
| $library.Update() |
This file contains hidden or 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-Module $((Get-ChildItem -Path $($env:LOCALAPPDATA+"\Apps\2.0\") -Filter CreateExoPSSession.ps1 -Recurse ).FullName | Select-Object -Last 1) | |
| # ensure that your session is kept open for a longer period of time (see https://msunified.net/category/office-365/) | |
| $global:UserPrincipalName="putYourAdminAccountHere" | |
| Connect-EXOPSSession -UserPrincipalName $global:UserPrincipalName | |
| # run your code here | |
| Disconnect-EXOPSSession |
This file contains hidden or 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
| $disableWelcomeMessage = $false | |
| get-unifiedgroup | Where-Object { $_.WelcomeMessageEnabled -eq $disableWelcomeMessage } | Set-UnifiedGroup -UnifiedGroupWelcomeMessageEnabled:(!$disableWelcomeMessage) |
This file contains hidden or 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
| $tenant = "putYourTenantNameHere" | |
| $siteUrl = "putYourSiteUrlHere" | |
| Connect-SPOService "https://$tenant-admin.sharepoint.com" | |
| # parameter can be ReadOnly, NoAccess, or Unlock | |
| Set-SPOSite $siteUrl -LockState "ReadOnly" |
This file contains hidden or 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
| $tenant = "yourTenantName" | |
| $sharePointAdminUrl = "https://$tenant-admin.sharepoint.com" | |
| $spoUrl = "yourSiteUrl" | |
| Connect-SPOService $sharePointAdminUrl | |
| $site = Get-SPOSite $spoUrl | |
| $site.Template | |
| $site.GroupId | |
| $site.Owner |
This file contains hidden or 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
| $tenant = "putYourTenantNameHere" | |
| $spoAdminUrl = "https://$tenant-admin.sharepoint.com" | |
| # must be either a modern Team Site, communication site, or classic site when targeting the root site | |
| # must be either a Search Center Site or Basic Search Center Site when targeting the /search URL | |
| $sourceUrl = "putYourSourceSiteUrlHere" | |
| # e.g. "https://$tenant-admin.sharepoint.com/site/yourarchive" | |
| $archiveUrl = "putYourArchiveUrlHere" | |
| # can be "https://$tenant-admin.sharepoint.com" or "https://$tenant-admin.sharepoint.com/search" | |
| $targetUrl = "https://$tenant-admin.sharepoint.com" |
This file contains hidden or 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
| $baererToken = "Put your baerer token here" | |
| $yammerBaseUrl = "https://www.yammer.com/api/v1" | |
| Function Get-BaererToken() { | |
| $headers = @{ Authorization=("Bearer " + $baererToken) } | |
| return $headers | |
| } | |
| $headers = Get-BaererToken | |
| $urlToCall = "$($yammerBaseUrl)/groups" |
OlderNewer