マイナーでもいいよね??

殆どVB系、でも .NET じゃない VB は知らないよん

目次

Blog 利用状況

書庫

日記カテゴリ

DirectoryEntry.ObjectSecurityプロパティ

Active Directory データのプロパティ出力で、セキュリティ記述子(nTSecurityDescriptor)を出力する際に、ADSI の IADsSecurityDescriptor、IADsAccessControlList、IADsAccessControlEntry の 3 つのインターフェイスを使いました。

MSDN のセキュリティ記述子の管理のページを見ると、Active Directory オブジェクト セキュリティ記述子と共に使用されるプライマリ クラスは ActiveDirectorySecurity で、DirectoryEntry.ObjectSecurity プロパティを使用すると、Active Directory オブジェクトのセキュリティ記述子を表す ActiveDirectorySecurity オブジェクトを取得できる と書いてあります。

更に次のことも書かれています。

随意アクセス制御リストのアクセス制御エントリは、アクセス規則とも呼ばれます。アクセス規則を表すプライマリ クラスは、ActiveDirectoryAccessRule クラスです。

 

ということは、IADsSecurityDescriptor に対応するのが ActiveDirectorySecurity で、IADsAccessControlEntry に対応するのが ActiveDirectoryAccessRule ってことなんでしょうかね。

ちょっとサンプルコード書いて確認してみましたが、

ActiveDirectorySecurity.GetAccessRules メソッドで アクセス規則のコレクション(型は AuthorizationRuleCollection)を取得でき、これは IADsSecurityDescriptor.DiscretionaryAcl プロパティ(型は Object なので IADsAccessControlList にキャスト)に対応してるようです。

AuthorizationRuleCollection の要素(アクセス規則)は AuthorizationRule クラスですが、実際の型は継承クラスである ActiveDirectoryAccessRule です。

 

IADsAccessControlEntry には、出力対象にした Trustee、AccessMask、AceFlags、AceType、Flags プロパティがありますが、ActiveDirectoryAccessRule の方は、

AccessMask => ActiveDirectoryRights(型は ActiveDirectoryRights 列挙体)

AceType => AccessControlType(型は AccessControlType 列挙体)

Flags => ObjectFlags(型は ObjectAceFlags 列挙体)

ですが、AceFlags に対応するプロパティが判りませんでした。

また、Trustee に対応するプロパティも判らなかったんですが、Trustee の名前部分(ユーザ名やグループ名)は IdentityReference プロパティ(型は IdentityReference、実際の型は SecurityIdentifier)の Value プロパティ(型は String)を基に検索すれば取得できないことはないです。DirectorySearcher 使って objectSid を検索フィルタにして検索するんですけどね。

実装は特別難しい訳ではないですが、ちょっと面倒だしスマートじゃないなぁって感じです。

 

多分、ADSI の 3 つのインターフェイスの名前に似たクラスが .NET にあるはずなので調べてみます。

投稿日時 : 2013年12月20日 23:18

コメントを追加

# is erectile dysfunction treatable 2021/07/06 2:42 can hydroxychloroquine get you high

hydroxychlor 200 mg https://plaquenilx.com/# whats hcq

# re: DirectoryEntry.ObjectSecurity????? 2021/07/10 2:52 hydrochlorazine

cloraquine https://chloroquineorigin.com/# how long has hydroxychloroquine been around

# re: DirectoryEntry.ObjectSecurity????? 2021/07/16 9:01 hydroxychlor tab 200mg

chloroquine vs chloroquine phosphate https://chloroquineorigin.com/# hydroxochlorquine

# re: DirectoryEntry.ObjectSecurity????? 2021/07/25 23:36 define chloro

is chloroquine phosphate over the counter https://chloroquineorigin.com/# hydroxychloroquine safe

# re: DirectoryEntry.ObjectSecurity????? 2021/08/09 2:03 what is hydroxychloroquine

premature babies wikipedia https://chloroquineorigin.com/# how safe is hydroxychloroquine

# ebdmufspmsft 2021/11/29 2:00 dwedayidgd

chloroquine 500 mg https://hydroaralenus.com/

# iimwvbtdfcgo 2022/05/06 20:54 iuwwvg

hydroxycloro https://keys-chloroquinehydro.com/

# ojqeigrrxzwh 2022/06/02 6:36 rxmvumzd

erythromycin medication http://erythromycinn.com/#

# Test, just a test 2022/12/15 18:19 candipharm

canadian pills online https://www.candipharm.com

# doors2.txt;1 2023/03/14 14:48 chErnFbCGxUubdfxAs

doors2.txt;1

# doors2.txt;1 2023/03/14 16:24 WUecXHpPPcaeITVIZKq

doors2.txt;1

タイトル  
名前  
URL
コメント