Juvigy

LDAP help

6 posts in this topic

#1 ·  Posted

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.

Share this post


Link to post
Share on other sites



#2 ·  Posted

Which directory do you try to access? Looks like it isn't Active Directory.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#3 ·  Posted

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.

Share this post


Link to post
Share on other sites

#4 ·  Posted

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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#5 ·  Posted

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?

Share this post


Link to post
Share on other sites

#6 ·  Posted

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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now