Lempke Posted November 6, 2006 Share Posted November 6, 2006 I want to use the following line in a script. $oUser = GetObject(LDAP://cn=Smith, Joe,ou=Sales,dc=MyDomain,dc=com) But this doesn't work due to the "," in de common name. Is there a way that I can solve this? Changing the common name to Joe Smith is not an option. I have to make it work with cn=Smith, Joe Please help Link to comment Share on other sites More sharing options...
/dev/null Posted November 6, 2006 Share Posted November 6, 2006 I want to use the following line in a script.$oUser = GetObject(LDAP://cn=Smith, Joe,ou=Sales,dc=MyDomain,dc=com)But this doesn't work due to the "," in de common name. Is there a way that I can solve this?Changing the common name to Joe Smith is not an option. I have to make it work with cn=Smith, JoePlease help$oUser = GetObject(LDAP://cn=Smith\, Joe,ou=Sales,dc=MyDomain,dc=com)CheersKurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
Lempke Posted November 6, 2006 Author Share Posted November 6, 2006 $oUser = GetObject(LDAP://cn=Smith\, Joe,ou=Sales,dc=MyDomain,dc=com)CheersKurtI have tried this but it didn't work... Link to comment Share on other sites More sharing options...
/dev/null Posted November 6, 2006 Share Posted November 6, 2006 I have tried this but it didn't work...that's the only way I know of. What's the error message?CheersKurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
Lempke Posted November 6, 2006 Author Share Posted November 6, 2006 Kurt Then I must have made a typo. I don't get an error, just no results in the things a want to retrieve. Link to comment Share on other sites More sharing options...
arcker Posted November 6, 2006 Share Posted November 6, 2006 mmm your question is not enough accurate LDAP and getobject WORKS well all the time If i understand well, your name is "Smith, Joe" ? are you sure ? this Distinguished Name is return by a request ? verify your syntax, and verify your rights. After, what do you want t return ? -- Arck System _ Soon -- Ideas make everything "La critique est facile, l'art est difficile" Projects :[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013 Get it Here [/list] Link to comment Share on other sites More sharing options...
/dev/null Posted November 6, 2006 Share Posted November 6, 2006 (edited) KurtThen I must have made a typo. I don't get an error, just no results in the things a want to retrieve.are you sure there is such an entry in your LDAP directory? In ADS there isusually only an entry for the "display name" of the user, which is usuallyof the format "firstname lastname" or "lastname firstname", so there isno "," between the two.e.g. "cn=joe test,ou=sales,dc=test,dc=com"or "cn=test joe,ou=sales,dc=test,dc=com"Use Softerras ldapbrowser (www.ldapbrowser.com) to view the content of your ADS structure and figure out how the user is stored in the directory.EDIT: In general - search the forum for "+objget +ldap" to find some working LDAP samples.EDIT#2: To be a bit more clear. It is absolutely possible to have a user with a DN of "cn=Smith\, Joe,ou=Sales,dc=MyDomain,dc=com" if you create it like that. It's just not the standard!CheersKurt Edited November 6, 2006 by /dev/null __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
arcker Posted November 6, 2006 Share Posted November 6, 2006 Yes, that's not a standart, and it could be really complex to lead it in the future if you plan to develop more ldap scripts for now, i think like /dev/null that your ADs path is not correct -- Arck System _ Soon -- Ideas make everything "La critique est facile, l'art est difficile" Projects :[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013 Get it Here [/list] Link to comment Share on other sites More sharing options...
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