#author("2021-11-26T00:09:08+09:00","","") #author("2021-11-26T00:13:26+09:00","","") [[ソフトウェア開発>SoftwareEngineering]] / [[Active Directory>./]] *Active Directory [#h42a99cd] -Microsoft 公式ページ --[[Active Directory TechCenter>http://technet.microsoft.com/ja-jp/activedirectory/default.aspx]] --[[Active Directory フォーラム>http://social.technet.microsoft.com/Forums/ja-JP/activedirectoryja/threads]] **ユーザープロパティ [#wb7e864b] -ツール [[ユーザーオブジェクトのプロパティを表示する>VBScript/ActiveDirectory/OutputUserProperty]] -GUI管理ツールから入力可能なプロパティ --[[全般/General>./UserProperty/General]] --[[住所/Address>./UserProperty/Address]] --[[アカウント/Account>./UserProperty/Account]] --[[プロファイル/Profile>./UserProperty/Profile]] --[[電話/Telephones>./UserProperty/Telephones]] --[[組織/Organization>./UserProperty/Organization]] -[[ユーザーアカウントコントロール>./UserAccountControlFlag]] -複雑なパスワード 下記の4種類のうち3種類以上を使用する。 --小文字 --大文字 --数字 --記号 *グループプロパティ [#he8551e1] -GUI管理ツールから入力可能なプロパティ --[[全般/General>./GroupProperty/General]] **SID履歴 [#ld2cebb3] ***SID履歴とは [#cda3a929] ***スクリプト [#o610d6aa] -[[SID履歴にSIDを追加する>VBScript/ActiveDirectory/AddSidHistory]] -[[SID履歴をクリアする>VBScript/ActiveDirectory/ClearSidHistory]] *未整理 [#b8824eea] **現在ログオンしているユーザーの情報を取得する方法 [#r0eddd87] *** 方法1 [#b7c33a57] #highlightjs([vbnet]) Dim systemInfo as Object = CreateObject("ADSystemInfo") Dim path as String = "LDAP://" & systemInfo.UserName Dim systemInfo As Object = CreateObject("ADSystemInfo") Dim path As String = "LDAP://" & systemInfo.UserName Dim entry as DirectoryEntry = New DirectoryEntry(path) Dim entry As DirectoryEntry = New DirectoryEntry(path) Debug.Print(entry.Properties("sn").Value) Debug.Print(entry.Properties("givenName").Value) Debug.Print(entry.Properties("displayName").Value) Debug.Print(entry.Properties("badPwdCount").Value) *** 方法2 [#a545af72] #highlightjs([vbnet]) Dim path as String = "LDAP://" & UserPrincipal.CUrrent.DistinguishedName Dim path As String = "LDAP://" & UserPrincipal.CUrrent.DistinguishedName Dim entry as DirectoryEntry = New DirectoryEntry(path) Dim entry As DirectoryEntry = New DirectoryEntry(path) Debug.Print(entry.Properties("sn").Value) Debug.Print(entry.Properties("givenName").Value) Debug.Print(entry.Properties("displayName").Value) Debug.Print(entry.Properties("badPwdCount").Value) *** 方法3 [#h8d0dff2] #highlightjs([vbnet]) Debug.Print(UserPrincipal.CUrrent.Surname) Debug.Print(UserPrincipal.CUrrent.GivenName) Debug.Print(UserPrincipal.CUrrent.DisplayName) Debug.Print(UserPrincipal.CUrrent.BadLogonCount) **ユーザー名とパスワードが有効かどうかを検証する方法 [#sb792403] *** 方法1 [#qe02ca26] #highlightjs([vbnet]) Dim context As PrincipalContext = New PrincipalContext(ContextType.Domain) context.ValidateCredentials(userName, password)