robdogg1955

_AD_Open Fails When Script is Compiled

4 posts in this topic

I kept having problems with my Active Directory scripts. I finally discovered that they work fine before being compiled but after compiling they fail. I have narrowed it down to simply testing _AD_Open. For instance, any script that includes "$iResult = _AD_Open()" works until I compile the script. The compiled script fails with @Error = 4. Please note that I only log onto the computer with my Domain account. What am I missing here? Also, I do not use SciTE, I use Notepad++ if that matters...

Share this post


Link to post
Share on other sites



Copy the exe to another location and try again. I once had problems with "secure locations" in Windows. You can only start programs from directories defined as secure.
http://blogs.technet.com/b/askds/archive/2008/01/31/security-policy-settings-and-user-account-control.aspx


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-02-03 - Version 1.4.7.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

I think you are on to something. I just held shift key and right clicked the exe so I could choose run as a different user. I then entered my username and password and it worked fine with one caveat, I had to copy the exe to the desktop. If I tried to run it from the mapped network drive it told me that the drive did not exist. I see this all the time at my location and I finally found that I have to turn on "enablelinkedconnections" in the registry (change registry setting from 0 to 1). This must be the problem. As a side note, I have been working very hard on some scripts that use your AD.au3 UDF. I want to tell you how great it is to know that you support it. You are truly a fantastic person and I thank you!

Share this post


Link to post
Share on other sites

Thanks! Glad you like the UDF and the support you get from the forum :)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-02-03 - Version 1.4.7.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

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

  • Similar Content

    • BSB
      By BSB
      When I try _AD_Open() with no parameters I get this error message...
      Function _AD_Open encountered a problem.  @error=4, @extended = -2147023541
      When I try  _AD_Open($sUserIDParam = "XXXX@XXXX.com", $sPasswordParam = "XXXX", $sAD_DNSDomainParam = "", $sAD_HostServerParam = "", $sAD_ConfigurationParam = "") I get this error message....
      Function _AD_Open encountered a problem.  @error=4, @extended = -2147016646
      The rest of my code attempts to move a computer from one OU to another.  It errors out telling me that there is no such OU.  My guess is that is because I am not logged in to Active Directory so I have to solve the login issue first before tackling this the move.  The XXXX's above are replaced in my code with a domain admin account that "should" have permissions to do a computer move from one OU to another.
    • Darien
      By Darien
      Good afternoon,
      I am running the instructions below, and even using a username or password missing, $error always returns "The operation completed successfully."
          $result = _AD_Open ( $user , $password , "dc=proxy,dc=trtsp,dc=jus,dc=br" , "proxy.trtsp.jus.br" )
          If @error <> 0 Then
               $error = _AD_GetlastADSIError ()
               _ArrayDisplay ( $error )
              Exit
          EndIf
      Version of AD is 1.4.0.0 in AutoIt 3.3.8.1 (https://www.autoitscript.com/forum/topic/106163-active-directory-udf/).
      someone could tell me why this occurs rather than showing the detailed description of an error when the login fails using _ad_open?