共用方式為


New-AzureADMSGroup

建立 Azure AD 群組。

語法

New-AzureADMSGroup
   [-LabelId <String>]
   [-Description <String>]
   -DisplayName <String>
   [-IsAssignableToRole <Boolean>]
   -MailEnabled <Boolean>
   -MailNickname <String>
   -SecurityEnabled <Boolean>
   [-GroupTypes <System.Collections.Generic.List`1[System.String]>]
   [-MembershipRule <String>]
   [-MembershipRuleProcessingState <String>]
   [-Visibility <String>]
   [<CommonParameters>]

Description

New-AzureADMSGroup Cmdlet 會建立 Azure Active Directory (Azure AD) 群組。

如需建立動態群組的相關信息,請參閱使用屬性建立進階規則 (https://azure.microsoft.com/en-us/documentation/articles/active-directory-accessmanagement-groups-with-advanced-rules/) 。

範例

範例 1:建立動態群組

PS C:\> New-AzureADMSGroup -DisplayName "Dynamic Group 01" -Description "Dynamic group created from PS" -MailEnabled $False -MailNickname "group" -SecurityEnabled $True -GroupTypes "DynamicMembership" -MembershipRule "(user.department -contains ""Marketing"")" -MembershipRuleProcessingState "On"

Id                            : 9126185e-25df-4522-a380-7ab697a7241c
Description                   : Dynamic group created from PS
OnPremisesSyncEnabled         : 
DisplayName                   : Dynamic Group 01
OnPremisesLastSyncDateTime    : 
Mail                          : 
MailEnabled                   : False 
MailNickname                  : group 
OnPremisesSecurityIdentifier  : 
ProxyAddresses                : {} 
SecurityEnabled               : True 
GroupTypes                    : {} 
MembershipRule                : (user.department -eq "Marketing") MembershipRuleProcessingState : Paused

此指令會建立具有下列規則的新動態群組:

'user.department -contains “Marketing”'

雙引號會以單引號取代。

處理狀態為 [開啟]。 這表示符合規則資格的目錄中所有用戶都會新增為群組的成員。 任何不符合資格的用戶都會從群組中移除。

範例 2:建立可指派給角色的群組

PS C:\> New-AzureADMSGroup -DisplayName "HelpDesk admin group" -Description "Group assignable to role" -MailEnabled $False -MailNickname "helpDeskAdminGroup" -SecurityEnabled $True -IsAssignableToRole $True -Visibility "Private"

Id                            : 1026185e-25df-4522-a380-7ab697a7241c
Description                   : Group assignable to role
OnPremisesSyncEnabled         : 
DisplayName                   : HelpDesk admin group
Mail                          : 
MailEnabled                   : False
IsAssignableToRole            : True 
MailNickname                  : helpDeskAdminGroup
ProxyAddresses                : {} 
SecurityEnabled               : True 
GroupTypes                    : {}

範例 3:建立具有標籤指派的群組

PS C:\> New-AzureADMSGroup -Description "Group associated with a label" -DisplayName "HelpDesk admin group" -GroupTypes "Unified" -LabelId "00000000-0000-0000-0000-000000000000" -MailEnabled $True -MailNickname "helpDeskAdminGroup" -SecurityEnabled $False

Id                            : 11111111-1111-1111-1111-111111111111
Description                   : Group associated with a label
DisplayName                   : HelpDesk admin group
GroupTypes                    : ["Unified"]
MailEnabled                   : True
MailNickname                  : helpDeskAdminGroup
SecurityEnabled               : False

參數

-Description

指定群組的描述。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-DisplayName

指定群組的顯示名稱。

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-GroupTypes

指定群組是動態群組。 若要建立動態群組,請指定 DynamicMembership 的值。

類型:List<T>[String]
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-IsAssignableToRole

旗標指出是否可以將群組指派給角色。 此屬性只能在建立群組時設定,而且無法在現有群組上修改。

類型:Boolean
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-LabelId

指定要指派給群組的標籤碼逗號分隔清單。

目前,只有一個標籤可以指派給群組。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-MailEnabled

指定此群組是否已啟用郵件。

目前,您無法在 Azure AD 中建立已啟用郵件的群組。

類型:Boolean
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-MailNickname

指定群組的郵件昵稱。 如果 MailEnabled 是$False您仍必須指定郵件昵稱。

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-MembershipRule

指定動態群組的成員資格規則。

如需可用於動態群組之規則的詳細資訊,請參閱使用屬性建立進階規則 (https://azure.microsoft.com/en-us/documentation/articles/active-directory-accessmanagement-groups-with-advanced-rules/) 。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-MembershipRuleProcessingState

指定規則處理狀態。 此參數可接受的值為:

  • “On”。 處理群組規則。
  • “Paused”。 停止處理群組規則。

變更處理狀態的值並不會變更群組的成員清單。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-SecurityEnabled

指定群組是否已啟用安全性。 對於安全組,此值必須$True。

類型:Boolean
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-Visibility

此參數決定群組內容和成員清單的可見度。 此參數可以採用下列其中一個值:

  • 「公用」- 任何人都可以檢視群組的內容
  • “Private” - 只有成員可以檢視群組的內容
  • “HiddenMembership” - 只有成員可以檢視群組的內容,且只能檢視成員、擁有者、全域/公司管理員、使用者管理員和技術服務人員可以檢視群組的成員清單。

如果未提供任何值,預設值會是 “Public”。

注意:

  • 此參數僅適用於 groupType 設定為 「Unified」 的群組。
  • 如果群組的這個屬性設定為 「HiddenMembership」,則稍後無法變更。
  • 任何人都可以加入已將此屬性設定為 「公用」的群組。 如果屬性設定為 Private 或 HiddenMembership,則只有擁有者 () 可以將新成員新增至群組,並要求加入群組需要核准擁有者 () 。
類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

輸入

None

輸出

Object

備註

此 Cmdlet 目前處於公開預覽狀態。 當 Cmdlet 處於公開預覽狀態時,我們可能會對可能會有非預期效果的 Cmdlet 進行變更。 建議您不要在生產環境中使用此 Cmdlet。