[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Is it possible to pull Active directory Information with an Autoit script

Posted on 2007-10-17
6
Medium Priority
?
7,319 Views
Last Modified: 2012-05-05
I'm try to write an Autoit script and I need the script to be able to pull the profile path out of active directory so it can find a file in a specific path under their profile.

is this a possibility? if so what would the script look like.

if you need more info let me know i'll provide as much as i can.
0
Comment
Question by:tlman12
  • 4
  • 2
6 Comments
 
LVL 65

Expert Comment

by:RobSampson
ID: 20099179
This would work in VBS:
Set objADSysInfo = CreateObject("ADSystemInfo")
Set objUser = GetObject("LDAP://" & objADSysInfo.UserName)
strProfile = objUser.profilePath
MsgBox strProfile

But I'm not sure whether AutoIt accepts the same syntax....

Regards,

Rob.
0
 
LVL 2

Author Comment

by:tlman12
ID: 20105788
Ya I was pretty sure that it was possible in VBS. My only problem with that is that I don't know one think about VBS so...

I was hoping that there would be some kind of syntax that would allow AutoIt to pull the same information.

If anyone else has any other information it would be greatly appreciated
0
 
LVL 65

Accepted Solution

by:
RobSampson earned 2000 total points
ID: 20106258
If AutoIt doesn't support VBScript, how about using a script that someone has written to perform Active Directory functions?
http://www.autoitscript.com/forum/index.php?automodule=downloads&showfile=66

Regards,

Rob.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 65

Expert Comment

by:RobSampson
ID: 20106285
Or, I don't know AutoIt scripting at all, but by looking at other posts, as a direct conversion of the four VBS lines, try

Local $objADSysInfo = ObjCreate("ADSystemInfo")
Local $objUser = ObjGet("LDAP://" & $objADSysInfo.UserName)
Local $strProfile = $objUser.profilePath
ConsoleWrite($strProfile)

Source: http://www.autoitscript.com/forum/lofiversion/index.php?t17522.html

Regards,

Rob.
0
 
LVL 2

Author Comment

by:tlman12
ID: 20113264
Eureka i think your on to something her.

you got two parts of a whole answer :)

I think it will work. the first part the AD functions file has to be included in the script you use the vbs conversion

if this isn't the exact code i'm sure i'll be able to parse through the functions file to find what i'm looking for

thank you very much for your help
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 20116751
No problem.  Glad I could help.  I hope you can find your solution with relative ease....

Regards,

Rob.
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to deal with a specific error when using the Enable-RemoteMailbox cmdlet to create a mailbox in the cloud-based service, for an existing user in an on-premises Active Directory.
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
Progress
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

868 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question