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
$Setting = Get-AzureADObjectSetting -TargetObjectId $GroupId -TargetType Groups | |
if ($Setting -eq $null) | |
{ | |
Write-Host "`t`tCreating new policy" | |
$Template1 = Get-AzureADDirectorySettingTemplate | where -Property Id -Value "08d542b9-071f-4e16-94b0-74abb372e3d9" -EQ | |
$SettingCopy = $Template1.CreateDirectorySetting() | |
$SettingCopy["AllowToAddGuests"]=$True | |
New-AzureADObjectSetting -TargetType Groups -TargetObjectId $GroupId -DirectorySetting $SettingCopy -ErrorAction SilentlyContinue -ErrorVariable SetPolicyError | |
} |
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
function Get-CorpMicrosoftGraphAccessToken | |
{ | |
Param( | |
[Parameter(Mandatory=$true)] | |
[string]$TenantId, | |
[Parameter(Mandatory=$true)] | |
[string]$ClientId, | |
[Parameter(Mandatory=$true)] | |
[string]$ClientSecret | |
) |
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
function Send-CorpMicrosoftGraphPostRequest | |
{ | |
Param( | |
[Parameter(Mandatory=$true)] | |
[string]$Domain, | |
[Parameter(Mandatory=$true)] | |
[string]$AppId, | |
[Parameter(Mandatory=$true)] | |
[string]$AppSecret, | |
[Parameter(Mandatory=$true)] |
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
function Get-CorpMicrosoft365GroupAlias | |
{ | |
Param( | |
[Parameter(Mandatory=$true)] | |
[string]$Alias | |
) | |
$AliasFound = $false | |
$Retries = 0 | |
$UniqueAlias = $Alias |
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
# Time in UTC | |
$StartTime = Get-Date "23.08.2022 10:15:00" | |
# Set timezone | |
$TimeZone = [System.TimeZoneInfo]::FindSystemTimeZoneById("W. Europe Standard Time") | |
# Get time in local timezone | |
$StartTimeLocal = [System.TimeZoneInfo]::ConvertTimeFromUtc($StartTime, $TimeZone) | |
Write-Output "Start: $($StartTime) - Start, local: $($StartTimeLocal) - Timezone: $($TimeZone.DisplayName)" |
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
# Connect to the site | |
Connect-PnPOnline -Url "https://contoso.sharepoint.com/sites/Project101" | |
# Temporary disable setting to allow access to the property bag | |
Set-PnPSite -DenyAndAddCustomizePages $false | |
# Set value in property bag | |
Set-PnPPropertyBagValue -Key "TeamifyHidden" -Value "TRUE" | |
# Re-enable setting to keep recommended security level |
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
$SiteUrl = "https://contoso.sharepoint.com/sites/Project101" | |
# Connect to SPO using a interactive login | |
Connect-PnPOnline -Url $SiteUrl | |
# Invoke request to the SPO REST API | |
$Body = "{'siteUrl': '$($SiteUrl)'}" | |
Invoke-PnPSPRestMethod -Method Post -Url "/_api/GroupSiteManager/HideTeamifyPrompt" -Content $Body -Raw | |
# Expected response: {"odata.null":true} |
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
Connect-PnPOnline -Url https://contoso.sharepoint.com/sites/project101 | |
$Web = Get-PnPWeb -Includes NextStepsFirstRunEnabled | |
$Web.NextStepsFirstRunEnabled = $false | |
$Web.Update() | |
Invoke-PnPQuery |
NewerOlder