Jump to content

Active Directory Example Scripts


water
 Share

Recommended Posts

Version 1.2.0 has been released.

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

  • 1 month later...

Hello,

I really like the GetOUTreeView script, but I've found an issue with the output . See attached.

All of the sub OU's that are under "MCR Postini Quarantine" should actually be under the "Mcr" OU above it (which shows as having no sub-ou's). I'm guessing this is because they both start with "mcr ... " and it's tripping the script up? The correct DN name is showed however for the OU's (eg, "Corp" would show as being in "Mcr" when clicking "Select OU")

post-62918-0-42469400-1326991986_thumb.j

Edited by Readysound
Link to comment
Share on other sites

This problem is caused by the spaces in the OU name. The table to create the TreeView isn't sorted propery.

Please check for a solution (ugly but it works).

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

Remove this lines:

Local $aAD_OUs[9][2] = [[8,2]]
$aAD_OUs[1][0] = "Root" & @Tab & "Partners"
$aAD_OUs[1][1] = "Root" & @Tab & "Partners"
$aAD_OUs[2][0] = "Root" & @Tab & "Partners.Disabled"
$aAD_OUs[2][1] = "Root" & @Tab & "Partners.Disabled"
$aAD_OUs[3][0] = "Root" & @Tab & "Partners.Disabled Never Used"
$aAD_OUs[3][1] = "Root" & @Tab & "Partners.Disabled Never Used"
$aAD_OUs[4][0] = "Root" & @Tab & "Partners.Inactive - Migrated from Media"
$aAD_OUs[4][1] = "Root" & @Tab & "Partners.Inactive - Migrated from Media"
$aAD_OUs[5][0] = "Root" & @Tab & "Partners" & @Tab & "Example 1"
$aAD_OUs[5][1] = "Root" & @Tab & "Partners" & @Tab & "Example 1"
$aAD_OUs[6][0] = "Root" & @Tab & "Partners.Disabled" & @Tab & "Example 2"
$aAD_OUs[6][1] = "Root" & @Tab & "Partners.Disabled" & @Tab & "Example 2"
$aAD_OUs[7][0] = "Root" & @Tab & "Partners.Disabled Never Used" & @Tab & "Example 3"
$aAD_OUs[7][1] = "Root" & @Tab & "Partners.Disabled Never Used" & @Tab & "Example 3"
$aAD_OUs[8][0] = "Root" & @Tab & "Partners.Inactive - Migrated from Media" & @Tab & "Example 4"
$aAD_OUs[8][1] = "Root" & @Tab & "Partners.Inactive - Migrated from Media" & @Tab & "Example 4"
and change this
;   Local $aAD_OUs = _AD_GetAllOUs($sAD_OU, $sSeparator)
to
Local $aAD_OUs = _AD_GetAllOUs($sAD_OU, $sSeparator)

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

Made those changes and get an error when building :

C:\Program Files\AutoIt3\Include\AD.au3 (1347) : ==> Variable must be of type "Object".:

$oAD_Command.CommandText = "<LDAP://" & $sAD_HostServer & "/" & $sAD_Root & ">;" & "(objectCategory=organizationalUnit)" & ";distinguishedName;subtree"

$oAD_Command^ ERROR

Link to comment
Share on other sites

Remove the ";" from lines "; _AD_Open()" and "; If $bAD_IsADOpen = False Then _AD_Close()"

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

:)

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

  • 1 month later...

A new example script is available: ADAT - Active Directory Administration Tool

General

  • ADAT is a tool to simplify common AD administration tasks
  • Every administration task has its own tab (3 sample tabs are provided)
  • It is easy to add new functions (tabs) to the tool or remove them - check file "ADAT config.txt" in the ZIP archive for a description
  • Some of the often used functions are available: list users, computers, OUs
  • File ADAT.ini can be customized to hold the AD logon information if necessary. By default the user running the script connects to the AD
More details can be found on the first post.

Screenshots

post-7903-0-30578600-1330265795_thumb.pnpost-7903-0-04454600-1330265988_thumb.pnpost-7903-0-37650800-1330265997_thumb.pn

Edited by water

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 weeks later...

Experimental Version 1.2.1.0 has been released.

For testing purpose only!

Needs 3.3.9.2 beta for the new way the UDF handles COM errors!

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

  • 1 month later...

New version (1.2.0) of the _AD_Example_GetOUTreeView example script added to post #1.

3 parameters have been added to display the number of objects in an OU to the right of the OUs name:

$sAD_Category:

If this parameter is set to an ObjectClass (computer, user, group ...) or a complete LDAP query string the number of found objects will be display to the right of the OUs name

$sAD_Text:

Text to display the count. Must contain a % which will be replaced by the actual number (default = " (%)")

$iAD_SearchScope:

Search scope for function _AD_GetObjectsInOU. Can be 1 = only counts in the OU, 2 = counts in the OU and all sub-OUs (default = 1)

post-7903-0-07125600-1337355074_thumb.pn

Edited by water

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...

Experimental Version 1.2.2.0 has been released.

For testing purpose only!

Needs 3.3.9.2 beta for the new way the UDF handles COM errors!

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

  • 1 month later...

Version 1.3.0.0 of the UDF has been released.

This version combines the last production version 1.2.0 and the experimental version 1.2.2.0!

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

  • 2 weeks later...

Hi,

Using Active Directory Report, I get the error "More than 254 User selected!". But I am using Excel 2007 (32 bit Office installed in Windows 7 x64).

If I change the "If $oExcel.Application.Version <= 12.0" to 11.9 then it continues but hangs processing records.

Where should I be getting ExcelCOM_UDF.au3 from? Maybe that is the problem.

Always carry a towel.

Link to comment
Share on other sites

What do you get if you add

msgBox(0, "", $oExcel.Application.Version)
before this line?

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

It's a bug in my example script. The line should read:

If $oExcel.Application.Version < 12.0

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

It's a bug in my example script. The line should read:

If $oExcel.Application.Version < 12.0

OK! Now it gets stuck processing AD records (380 of 387).

I am querying groupnames for an OU. The OU is part of a very large AD domain. The groups have members from trusted domains whose DCs are in other places on the planet and available only over slow cloud connections. These trusted domains are also very large.

If I _ArrayDisplay($aUsers) at the end of _Transpose() I see all the data in the array. This comes after some few minutes. It includes the user infos in columns 0 and 1, and the grouplist in column 3.

Excel can be seen to start in the background and is consuming only very small CPU (0.01-0.04 in Process Explorer). That is why I asked about the correct ExcelCOM_UDF.au3 to use - I think the problem could be there. When I kill the task, AutoIT opens the ExcelCOM_UDF with warnings:

WARNING: $sFound: declared, but not used in func.

WARNING: $iCurrCol possibly not declared/created yet

Not sure that the warnings are relevant.

Unfortunately I will leave to go on holiday for a week in a few moments, and I'm sure you must sleep sometime. :-) Perhaps we can continue our troubleshooting when I return?

Always carry a towel.

Link to comment
Share on other sites

Sure, we can troubleshoot when you return.

Have a nice vacation!

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

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
 Share

  • Recently Browsing   0 members

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