Usually in my program I use this to get what I need.
Set objUser = GetObject("LDAP://cn=Lastn
ame/, Firstname,ou=Users,ou=1105
,ou=Plants
,dc=MyComp
any,dc=com
")
What I'm trying to accomplish here is in my program I get the User Logon Name (usually p########) of the person logged on to the computer. Then I want to be able to find out their Name in Active Directory. So far I haven't really seen anything that uses the UserLogonName as a criteria to search for stuff in AD. I've only seen stuff using the name, which is what I'm trying to figure out based on theire LogonName so I need a way where I can kind of a reverse lookup, if that makes any sense. I don't think there's a way to get their Name from windows instead since they are logging on with a numerical ID. This is why I'll need to get the information from AD. Can anyone guide me in the right direction? Thanks a bunch.
Start Free Trial