New-EntraBetaObjectSetting
Creates a settings object.
Syntax
Default (Default)
New-EntraBetaObjectSetting
-DirectorySetting <DirectorySetting>
-TargetType <String>
-TargetObjectId <String>
[<CommonParameters>]
Description
The New-EntraBetaObjectSetting
cmdlet creates a settings object in Microsoft Entra ID.
Examples
Example 1: Creates a settings object
Connect-Entra -Scopes 'Directory.ReadWrite.All'
$template = Get-EntraBetaDirectorySettingTemplate | Where-Object { $_.displayname -eq 'Group.Unified.Guest' }
$setting = $template.CreateDirectorySetting()
$setting['AllowToAddGuests'] = $False
$group = Get-EntraBetaGroup -Filter "DisplayName eq 'Sales and Marketing'"
New-EntraBetaObjectSetting -TargetType 'Groups' -TargetObjectId $group.Id -DirectorySetting $setting
Id DisplayName TemplateId
-- ----------- ----------
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb 22cc22cc-dd33-ee44-ff55-66aa66aa66aa
This command creates a new settings object.
-TargetType
Parameter specifies the type of the directory object.-TargetObjectId
Parameter specifies the ID of directory object to which to assign settings.-DirectorySetting
Parameter Create a new setting using templates fromDirectorySettingTemplates
Parameters
-DirectorySetting
Specifies the new settings.
Parameter properties
Type: | DirectorySetting |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | True |
Value from remaining arguments: | False |
-TargetObjectId
Specifies the ID of directory object to which to assign settings.
Parameter properties
Type: | System.String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | True |
Value from remaining arguments: | False |
-TargetType
Specifies the type of the directory object to which to assign settings.
Parameter properties
Type: | System.String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | True |
Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.