Monday, October 23, 2017

Add Usage Guidelines Url for Office 365 Group

While I was configuring Classification for Groups, when I sported the UsageGuidelinesUrl and GuestUsageGuidelinesUrl option. When set, a link appears in the Site Information box.

Guideline

PowerShell to add, update, read and remove the guidelines urls

Add

# get the settings id default template for Groups
$settingTemplateID = Get-AzureADDirectorySettingTemplate | ? -Property "DisplayName" -Value "Group.Unified" -EQ | select -ExpandProperty ID
#get the tempalte object
$Template = Get-AzureADDirectorySettingTemplate -Id $settingTemplateID
#create a setting object
$newSetting = $template.CreateDirectorySetting()
#set the property
$newSetting["GuestUsageGuidelinesUrl"] = "http://guestguideline.com"
$newSetting["UsageGuidelinesUrl"] = "https://guideline.com"
#save the settings object back to Office 365
New-AzureADDirectorySetting -DirectorySetting $newSetting

Update

#Get the setting id for Groups
$settingID = Get-AzureADDirectorySetting | Where-object -Property Displayname -Value "Group.Unified" -EQ | select -ExpandProperty ID
#Get current settings object with the Groups ID
$setting = Get-AzureADDirectorySetting –Id $settingID
#Update the property
$Setting["UsageGuidelinesUrl"] = "https://my-tenant.sharepoint.com/"
$Setting["GuestUsageGuidelinesUrl"] = "http://public-url"
#Save the settings object back to Office 365
Set-AzureADDirectorySetting -Id $settingID -DirectorySetting $Setting

Read

#read all settings
(Get-AzureADDirectorySetting -All $True).Values

Remove – All settings for Groups!

#remove all settings
$settingID = Get-AzureADDirectorySetting | Where-object -Property Displayname -Value "Group.Unified" -EQ | select -ExpandProperty ID
Remove-AzureADDirectorySetting –Id $settingID

2 comments: