0
我想爲使用C#(.NET 4.0)的特定用戶組設置AD(Active Directory,Windows Server 2008 R2)OU的List Content
和List Object
選項。如何以編程方式在AD OU條目上設置「列表內容」和「列表對象」權限?
我設法根據Microsoft設置gPOptions
和gPLink
屬性,但我沒有找到如何設置List Content
和List Object
一個例子。設置其他兩個屬性的作品,如下圖所示:
[...]
byte[] binaryForm = new byte[ groupPrincipal.Sid.BinaryLength ];
groupPrincipal.Sid.GetBinaryForm(binaryForm, 0);
IdentityReference identityReference =
new SecurityIdentifier(binaryForm, 0);
PropertyAccessRule propertyAccessRule =
new PropertyAccessRule(
identityReference,
AccessControlType.Allow,
PropertyAccess.Read,
new Guid("...value provided by MSDN link..."));
...
// ouEntry is of type DirectoryEntry
ouEntry.ObjectSecurity.AddAccessRule(propertyAccessRule);
ouEntry.CommitChanges();
...
// Same for gPLink with the corresponding GUID
請詢問您是否需要更多的信息。