Jump to content

Recommended Posts

Posted (edited)

I have a vbsctript that pulls information from Active Directory.  I am trying to use similar code in AutoIT.

 

I have this:

This works all the way to the point where I try to get the properties from the user account, then I get "The requested action with this object has failed."
 

The vbscript works fine, I just can't figure out why AutoIT fails.

Edited by ScottPostSr
Posted

Welcome to AutoIt and the forum!

Can you please post the code you use?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Posted

AutoIT:

$ado = ObjCreate("ADODB.Connection")

$ado.Open("Provider=ADsDSOObject")

$dn = $rs.Fields("distinguishedName").Value

$strTSHDPath = $User.terminalservicesHomeDirectory

$strTSProfile = $User.terminalServicesProfilePath

$strProfile = $User.HomeDirectory

Vbscript

Set oADO = CreateObject("ADODB.Connection")

oADO.Open "Provider=ADsDSOObject"

sDN = oRS.Fields("distinguishedName").Value

strHomeDir = oUser.HomeDirectory

strTSHomeDir = oUser.terminalservicesHomeDirectory

strTSProfile = oUser.terminalservicesProfilePath

Posted

There is a UDF available to interact with Active Directory. For download please check my signature.

Makes coding and error handling much easier.

#include <AD.au3>
_AD_Open()
$sTSHomeDirectory = _AD_GetObjectAttribute(@Username, "terminalservicesHomeDirectory")

I can't test at the moment so I'm not sure you can access the TerminalServices attributes this way because they are stored in a BLOB.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Posted

I still can't pull up the terminal services properties with AutoIT but can with vbscript.  Can you tell me how to post my code so it retains all the lines?  I have it in a text file, but can't figure out how to upload the text file.

Posted

To upload a file click on "Full Editor / Attachments".

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...