Juvigy Posted June 21, 2017 Posted June 21, 2017 Hi Guys, I would like to extract some information from our LDAP - username and terminationdate, But i am having issues writing the LDAP query Host=test.com Port=636 Base= uid=user1@test.net,ou=People,o=test1.com Scope=base Filter= objectclass=* Can anyone give me a small example based on the above info? I tried with _AD_GetObjectsInOU(....) and Local $oDS,$oUsr $oDS = ObjGet("LDAP:// ..... ) $oUsr = $oDS.GetObject("People", "cn=username") MSGBOX (0,"", $oUsr.terminationdate) But didn't get anything.
water Posted June 21, 2017 Posted June 21, 2017 Which directory do you try to access? Looks like it isn't Active Directory. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Juvigy Posted June 22, 2017 Author Posted June 22, 2017 I try to get the LDAP directory model. The fields i want are not existing in the AD 'people accounts'. I extract all fields with _AD_GetObjectProperties and 'terminationdate' is not there.
water Posted June 22, 2017 Posted June 22, 2017 LDAP is a protocol. The directory model depends on the Software you use (Active Directory etc.) My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Juvigy Posted June 22, 2017 Author Posted June 22, 2017 Ok, how do i accomplish that using the AD UDF ? BASE DN= "ou=people,o=test.com' I tried with _AD_Open("user", "pass") $mail2 = "CN="& StringStripWS($mail[$i],8) & ",OU=BG,OU=Users,OU=Accounts,DC=....,DC=....,DC=com" $test2 = _AD_GetObjectProperties(_AD_FQDNToSamAccountName($mail2) _AD_GetObjectProperties($test2) It works , but the field i am interested in is missing. Do i need to use more parameters in AD open or what?
water Posted June 22, 2017 Posted June 22, 2017 If _AD_GetObjectProperties does not return the required property then it either has never been set for the object or it is not available on the domain controller you connected to. Maybe if you access the Global Catalog by using additional parameters. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
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