Sign in to follow this  
Followers 0
quagmire1973

Querying Active Directory from AutoIT

3 posts in this topic

I currently use an autoit program in a Windows 2000 Active Directory domain. In AutoIT, there is a macro reference for a username. I use this username in a log file I generate from Autoit. The username is typically an Active Directory (AD) username for my domain. I would like my autoit script to pull the Full Name property from Active Directory so that I can log this information as well.

Any ideas?

Share this post


Link to post
Share on other sites



I would like my autoit script to pull the Full Name property from Active Directory

use wmi

_fullname()
  
  Func _fullname()
      $objInfo = ObjCreate("ADSystemInfo")
      $objUser = ObjGet("LDAP://" & $objInfo.Username & "")
      if @error then
          return @UserName
      endif
  Return $objUser.fullname
  EndFunc

Yes I stole it, so what

Share this post


Link to post
Share on other sites

use wmi

_fullname()
  
  Func _fullname()
      $objInfo = ObjCreate("ADSystemInfo")
      $objUser = ObjGet("LDAP://" & $objInfo.Username & "")
      if @error then
          return @UserName
      endif
  Return $objUser.fullname
  EndFunc

Yes I stole it, so what

Awesome. Thanks.

Now, I know squat about LDAP queries, so if my AD domain is say "gorak.com", how would I format the query?

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
Sign in to follow this  
Followers 0