訓練
認證
Microsoft Certified: Identity and Access Administrator Associate - Certifications
示範 Microsoft Entra ID 的功能,以現代化身分識別解決方案、實作混合式解決方案,以及實作身分識別治理。
領域 | 版本 | 適用的作業系統 |
---|---|---|
✅ 裝置 ❌ 使用者 |
✅ 專業版 ✅ 企業版 ✅ 教育版 ✅ Windows SE ✅ IoT 企業版 / IoT 企業版 LTSC |
✅Windows 10 版本 20H2 [10.0.19042] 和更新版本 |
./Device/Vendor/MSFT/Policy/Config/LocalUsersAndGroups/Configure
此設定可讓系統管理員管理裝置上的本機群組。 可能的設定:
警告
如果使用 Replace 和 Update 設定相同的群組,則 Replace 將會獲勝。
注意
RestrictedGroups/ConfigureGroupMembership 原則設定也可讓您設定成員 (使用者或 Microsoft Entra 群組) Windows 10 本機群組。 不過,它只允許以新成員完整取代現有的群組,而且不允許選擇性新增或移除。
從 Windows 10 20H2 版開始,建議使用 LocalUsersAndGroups 原則,而不是 RestrictedGroups 原則。 不支援將這兩個原則套用至相同的裝置,而且可能會產生無法預期的結果。
描述架構屬性:
屬性名稱 | 屬性值 |
---|---|
格式 |
chr (字串) |
存取類型 | 新增、刪除、取得、取代 |
允許的值:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0">
<xs:simpleType name="name">
<xs:restriction base="xs:string">
<xs:maxLength value="255" />
</xs:restriction>
</xs:simpleType>
<xs:element name="accessgroup">
<xs:complexType>
<xs:sequence>
<xs:element name="group" minOccurs="1" maxOccurs="1">
<xs:annotation>
<xs:documentation>Group Configuration Action</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attribute name="action" type="name" use="required" />
</xs:complexType>
</xs:element>
<xs:element name="add" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>Group Member to Add</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attribute name="member" type="name" use="required" />
</xs:complexType>
</xs:element>
<xs:element name="remove" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>Group Member to Remove</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attribute name="member" type="name" use="required" />
</xs:complexType>
</xs:element>
<xs:element name="property" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>Group property to configure</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attribute name="desc" type="name" use="required" />
<xs:attribute name="value" type="name" use="required" />
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="desc" type="name" use="required" />
</xs:complexType>
</xs:element>
<xs:element name="GroupConfiguration">
<xs:complexType>
<xs:sequence>
<xs:element name="accessgroup" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>Local Group Configuration</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
範例:
以下是組態的原則定義 XML 範例:
<GroupConfiguration>
<accessgroup desc = "">
<group action = ""/>
<add member = ""/>
<remove member = ""/>
</accessgroup>
</GroupConfiguration>
其中:
<accessgroup desc>
:指定要設定之本機群組的名稱或 SID。 如果您指定 SID, 則會使用 LookupAccountSid API 將 SID 轉譯為有效的組名。 如果您指定名稱, 則會使用LookupAccountName API來查閱群組並驗證名稱。 如果名稱/SID 查閱失敗,則會略過群組,並處理 XML 檔案中的下一個群組。 如果發生多個錯誤,最後一個錯誤會在原則處理結束時傳回。
<group action>
:指定要對本機群組採取的動作,這可以是 Update 和 Restrict,由您和 R 表示:
<add member>
:指定要設定之成員的 SID 或名稱。
<remove member>
:指定要從指定群組移除之成員的 SID 或名稱。
注意
指定使用者帳戶的成員名稱時,您必須使用下列格式 - AzureAD\userUPN。 例如,“AzureAD\user1@contoso.com” 或 “AzureAD\user2@contoso.co.uk”。 若要新增 Microsoft Entra 群組,您必須指定 Microsoft Entra 群組 SID。 Microsoft Entra 此原則不支援組名。 如需詳細資訊,請 參閱LookupAccountNameA函式。
如需如何建立自定義配置檔的資訊,請參閱在 Intune 中使用 Windows 10 裝置的自定義設定。
重要
<add member>
和 <remove member>
可以使用 Microsoft Entra SID 或使用者的名稱。 若要使用此原則新增或移除 Microsoft Entra 組,您必須使用群組的 SID。 Microsoft Entra 群組 SID 可以使用群組的圖形 API 來取得。 SID 存在於 屬性中 securityIdentifier
。<remove member>
中<add member>
指定 SID 時,會新增成員 SID,而不會嘗試解析它們。 因此,在指定 SID 時請非常小心,以確保它正確無誤。<remove member>
對 R (限制) 動作無效,如果有的話,將會忽略。範例 1:焦點 Microsoft Entra ID。
下列範例會使用 SID S-1-5-21-22222222-33333333333333-444444444-500 更新內建系統管理員群組,並 Microsoft Entra 帳戶 “bob@contoso.com” 和 Microsoft Entra 在已加入 Microsoft Entra 的計算機上使用 SID S-1-12-1-1111111111-222222222-333333333333-44444444444。
<GroupConfiguration>
<accessgroup desc = "S-1-5-21-2222222222-3333333333-4444444444-500">
<group action = "U" />
<add member = "AzureAD\bob@contoso.com"/>
<add member = "S-1-12-1-111111111-22222222222-3333333333-4444444444"/>
</accessgroup>
</GroupConfiguration>
範例 2:以 Microsoft Entra 用戶帳戶取代/限制內建系統管理員群組。
注意
使用 'R' 取代選項以 SID S-1-5-21-22222222-333333333333333333-44444444-500 設定內建 Administrators 群組時,您應該一律將系統管理員指定為成員加上任何其他自定義成員。 這是必要的,因為內建系統管理員必須一律是系統管理員群組的成員。
<GroupConfiguration>
<accessgroup desc = "S-1-5-21-2222222222-3333333333-4444444444-500">
<group action = "R" />
<add member = "AzureAD\bob@contoso.com"/>
<add member = "Administrator"/>
</accessgroup>
</GroupConfiguration>
範例 3:在混合式加入的計算機上新增和移除群組成員的更新動作。
下列範例示範如何使用 SID S-1-5-21-222222222-33333333333333333-44444444-500) 更新本機群 (組—使用其名稱 (Contoso\ITAdmins) 新增 AD 網域群組, 依 SID (S-1-12-1-1-11111111111-222222222-33333333333333-44444444) 新增 Microsoft Entra 群組,如果本機帳戶存在,請移除本機帳戶 (客體) 。
<GroupConfiguration>
<accessgroup desc = "S-1-5-21-2222222222-3333333333-4444444444-500">
<group action = "U" />
<add member = "Contoso\ITAdmins"/>
<add member = "S-1-12-1-111111111-22222222222-3333333333-4444444444"/>
<remove member = "Guest"/>
</accessgroup>
</GroupConfiguration>
注意
將 Microsoft Entra 群組 SID 新增至本機群組時,Microsoft Entra 帳戶登入許可權只會針對 Windows 10 裝置上的下列已知群組進行評估:
本節提供有關 LocalUsersAndGroups 原則 CSP 的一些常見問題解答。
基於安全性考慮,在 SAM/OS 層級封鎖從內建 Administrators 群組移除內建的系統管理員帳戶。 嘗試這樣做會導致失敗,並出現下列錯誤:
錯誤碼 | 符號名稱 | 錯誤描述 | 標頭 |
---|---|---|---|
0x55b (十六进制) 1371 (12 月) |
ERROR_SPECIAL_ACCOUNT | 無法在內建帳戶上執行此作業。 | winerror.h |
使用 R (Restrict) 動作來設定內建 Administrators 群組時,請在 中指定內建的系統管理員帳戶 SID/Name <add member>
以避免發生此錯誤。
是,您可以新增已經是群組成員的成員。 這不會對群組造成任何變更,也不會產生任何錯誤。
是,即使成員不是群組的成員,您還是可以移除該成員。 這不會對群組造成任何變更,也不會產生任何錯誤。
若要將網域群組新增為本機群組的成員,請在本機群組中 <add member>
指定網域群組。 使用完整帳戶名稱 (例如,domain_name\group_name) ,而不是隔離名稱 (例如,group_name) 以获得最佳结果。 如需詳細資訊 ,請參閱LookupAccountNameA函 式。
否,這是不允許的。 嘗試這麼做會導致 Intune 發生衝突。
將會略過無效的組名或 SID。 將會套用原則的有效部分,而且會在處理結束時傳回錯誤。 此行為與內部部署 AD GPP (群組原則 喜好設定) LocalUsersAndGroups 原則一致。 同樣地,將會略過無效的成員名稱,並在結尾傳回錯誤,以通知並非所有設定都已成功套用。
如果您在相同的 XML 中同時指定 R 和 U,R (Restrict) 動作會優先於 U (Update) 。 因此,如果群組在 XML 中出現兩次,一次是使用您,一次是使用 R,R 動作就會成功。
在用戶端裝置上套用原則之後,您可以調查事件記錄檔以檢閱結果:
LocalUsersAndGroups
搜尋字串以檢閱相關詳細數據。若要針對名稱/SID 查閱 API 進行疑難解答:
執行 下 列命令,在用戶端裝置上啟用lsp.log:
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Lsa" -Name LspDbgInfoLevel -Value 0x800 -Type dword -Force
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Lsa" -Name LspDbgTraceOptions -Value 0x1 -Type dword -Force
隨即會顯示 (C:\windows\debug\lsp.log) 的lsp.log 檔案。 此記錄檔會追蹤 SID-Name 解析。
執行下列命令來關閉記錄:
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Lsa" -Name LspDbgInfoLevel -Value 0x0 -Type dword -Force
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Lsa" -Name LspDbgTraceOptions -Value 0x0 -Type dword -Force
訓練
認證
Microsoft Certified: Identity and Access Administrator Associate - Certifications
示範 Microsoft Entra ID 的功能,以現代化身分識別解決方案、實作混合式解決方案,以及實作身分識別治理。