Jump to content

Active Directory UDF


water
 Share

Recommended Posts

i am very close i think but not quite there yet.  not sure what to put in for vbNullString

original script

#include <ad.au3>
#include <array.au3>
 
$msg_normal = 0
 
_AD_Open()
$array = _AD_GetObjectProperties(@ComputerName & "$", "distinguishedname")
 if @error then debug("error")
_AD_Close()
 
Const $ADS_SECURE_AUTHENTICATION = 1
Const $ADS_USE_SEALING = 64
Const $ADS_USE_SIGNING = 128
 
$objDSO = ObjGet("LDAP:")
 
$iSecurity = $ADS_SECURE_AUTHENTICATION + $ADS_USE_SEALING + $ADS_USE_SIGNING
 
$null = Default
 
$objFveInfos = $objDSO.OpenDSObject($strPathToComputer, $null, $null, $iSecurity)
 
Dim $filter[1] = ["msFVE-RecoveryInformation"]
 
$objDSO.Filter = $filter
 
for $objFveInfo in $objFveInfos
$strName = $objFveInfo.Get("name")
$strRecoveryPassword = $objFveInfo.Get("msFVE-RecoveryPassword")
Next
 
debug($strRecoveryPassword)
 
 
Func Debug($variable1 = "", $variable2 = "", $variable3 = "")
 
;~  #include <array.au3>
;~  $msg_normal = 0
 
If IsArray($variable1) Then
_ArrayDisplay($variable1)
Else
If $variable2 <> "" Then
$variable1 &= @CRLF & $variable2
EndIf
 
If $variable3 <> "" Then
$variable1 &= @CRLF & $variable3
EndIf
 
ClipPut($variable1)
MsgBox($msg_normal, "Debug", $variable1)
EndIf
 
EndFunc   ;==>Debug
Edited by gcue
Link to comment
Share on other sites

I checked my threads and I see that I got a lot of positive feedback from you. Do you use all of my UDFs?

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

 

Link to comment
Share on other sites

Gcue,

my post was in reply to the last post by KLM on the previous page.

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

 

Link to comment
Share on other sites

Download the latest beta version of AutoIt. Keyword "Null" is available then.

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

 

Link to comment
Share on other sites

I would try

$objFveInfos = $objDSO.OpenDSObject($strPathToComputer, Null, Null, $iSecurity)

with the latest AutoIt beta version.

And replace

$iSecurity = $ADS_SECURE_AUTHENTICATION + $ADS_USE_SEALING + $ADS_USE_SIGNING

with

$iSecurity = BitOr($ADS_SECURE_AUTHENTICATION, $ADS_USE_SEALING, $ADS_USE_SIGNING)

If it doesn't work I would add some error checking (check @error) and add a COM error handler.

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

 

Link to comment
Share on other sites

Did you set

_AD_ErrorNotify(2)

at the top of your script?

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

 

Link to comment
Share on other sites

strange.. when i removed the comm error handler i get this error in the console

C:scriptstest.au3(35,61) : ERROR: syntax error
$objFveInfos = $objDSO.OpenDSObject($strPathToComputer, Null,
 
also, i added your handler at the top
Link to comment
Share on other sites

You need to run this script with the latest Beta version of AutoIt. AutoIt 3.3.8.1 doesn't know keyword "Null".

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

 

Link to comment
Share on other sites

should i take this issue out of this topic?  aside from it not really being related to the udf, it might get more visibility outside of this topic to someone whose come across this issue.  i know you mentioned you dont have bitlocker in your environment so you cant really test.

and so i dont double post, i can remove the related posts from here

what do you think?

Edited by gcue
Link to comment
Share on other sites

To get more visibility starting a new thread would be a good idea.

Removing your posts from this thread isn't necessary.

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

 

Link to comment
Share on other sites

  • 3 months later...

Version 1.4.0.0 of the UDF has been released.
Supports AutoIt 3.3.10.x plus adds a few new functions.

Please test before using in production!

For download please see my signature.

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

 

Link to comment
Share on other sites

Hi water,

I've just installed the latest Autoit version (3.3.10.2) along with the AD UDF 1.4.0.0 and was going through all my programs to fix anything that was broken, when I encountered an error I can't get through.  One of my programs crashes as soon as the _AD_GetGroupMembers() function is called.

I wasn't sure about script-breaking changes, so I loaded the example for that particular function, and it doesn't work either on my system.  It exits with the exact same error:

>"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Users\kyo\Desktop\AutoIt\_AD Help and Examples\_AD_GetGroupMembers.au3" /UserParams    
+>08:55:58 Starting AutoIt3Wrapper v.2.1.4.0 SciTE v.3.3.7.0 ;  Keyboard:00001009  OS:WIN_7/Service Pack 1  CPU:X64 OS:X64    Environment(Language:040C  Keyboard:00001009  OS:WIN_7/Service Pack 1  CPU:X64 OS:X64)
>Running AU3Check (3.3.10.2)  params:-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6  from:C:\Program Files (x86)\AutoIt3
+>08:55:58 AU3Check ended.rc:0
>Running:(3.3.10.2):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\Users\kyo\Desktop\AutoIt\_AD Help and Examples\_AD_GetGroupMembers.au3"    
--> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop
"C:\Program Files (x86)\AutoIt3\Include\AD.au3" (1095) : ==> Subscript used on non-accessible variable.:
$aMembers[$iCount2] = $aMembersadd[$iCount2 - $iRangeModifier - 1]
$aMembers[$iCount2] = $aMembersadd^ ERROR
->08:55:59 AutoIt3.exe ended.rc:1
>Exit code: 1    Time: 0.512

I've got a similar error when trying the example for the _AD_GetGroupMemberOf() function.

I've tried going back to version 1.3.0.0 but with the AutoIt upgrade, that doesn't work anymore...

Thanks for any help!!

Kyo

Link to comment
Share on other sites

Is this a special group? What's the name of the group?

How many members are in the group?

Can you post the exact line where you call _AD_GetGroupMembers?

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

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...