Brenda1 Posted May 19, 2008 Posted May 19, 2008 Hello everybody, I have an issue with active Directory, here is the thing:I need to work with 2 objects in Active Directory: User Object and Contact Object. I used this code for get all the attributes I need from user object:$strCategory = "person" $path = "dc=na,dc=company,dc=domain" $field = "SamAccountName" $strUserName = "*" $objConnection = ObjCreate("ADODB.Connection") $objConnection.Open ("Provider=ADsDSOObject;") $objCommand = ObjCreate("ADODB.Command") $objCommand.ActiveConnection = $objConnection $objCommand.CommandText = "<LDAP://"& $path &">;(&(objectCategory=" & $strCategory & ")" & "("& $field & "=" & $strUserName & "));altRecipient;Subtree" $objRecordSet = $objCommand.ExecuteWith this as I said I can manipulate all the atributtes in "users object".Now my question is, what I need to modify in this code in order to have access to "Contacts Object" attributes. I believe I need to change the $strCategory, and $field variables, but I don't know the name I should use in Active Directory to Specify I want to get "contacts Object" attributes. Pleaseee Help!!!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now