954,591 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

find and query an LDAP path with PHP?

The following VBScript below displays a user's Active Directory Display Name. It first finds the user's LDAP path and then querys the path to display the username.

Unfortunately I'm a total newb when it comes to PHP.

I'm looking for the PHP code that will do this exact same thing. I need the PHP code to first find the current user's LDAP path, then query the current user's path to display their Active Directory Display name. Could someone please provide this relatively simple code for me? Can anyone point me to a link that has this code?
[CODE BELOW]

On Error Resume Next

Set objSysInfo = CreateObject("ADSystemInfo")

strUser = objSysInfo.UserName
Set objUser = GetObject("LDAP://" & strUser)

WScript.Echo objUser.displayName


Thank you and Kind Regards,
Jason

woofytalk
Newbie Poster
12 posts since Jan 2006
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You