‘ Get the domain string (“dc=domain, dc=local”) I have added a function of my own to determine whether an account is enabled or disabled.įunction GetStatus(ByVal SearchField As String, ByVal SearchString As String) As String ![]() GetAdsProp = objRecordSet.Fields(ReturnField) ' return value GetAdsProp = "not found" ' no records returned "(" & SearchField & "=" & SearchString & ")) " & SearchField & "," & ReturnField & " subtree" ' Search the AD recursively, starting at root of the domain ObjCommand.ActiveConnection = objConnection Set objCommand = CreateObject("ADODB.Command") ObjConnection.Open "Provider=ADsDSOObject " Set objConnection = CreateObject("ADODB.Connection") ![]() StrDomain = GetObject("LDAP://rootDSE").Get("defaultNamingContext") ' Get the domain string ("dc=domain, dc=local") Function GetAdsProp(ByVal SearchField As String, ByVal SearchString As String, ByVal ReturnField As String) As String
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |