How to execute a PowerShell script upon successful AD user creation or modification using ADManager Plus

How to execute a PowerShell script upon successful AD user creation or modification using ADManager Plus

ADManager Plus allows you to add custom PowerShell scripts upon successful Active Directory (AD) user creation or modification. 

 

Steps to add a custom PowerShell script to be executed upon successful user creation or modification:

    1. Logon to ADManager Plus and navigate to the AD Mgmt tab. 

    2. Under the User Management section, click on User Creation Templates

    3. Click on Create New Template and enter a suitable Template Name and Description

    4. Select the desired Domain

    5. Click on the Custom Attributes tab. 

    6. Select the Run custom script on successful user creation option.

    7. In the text field that appears below the Script Command, specify the location of your PowerShell script. 

    8. Following are the ways in which you can specify the script location:

      a. PowerShell C:\dir1\scr.ps1 %userName%

      b. PowerShell C:\dir~1\scr.ps1 %userName%

      c. PowerShell scr.ps1 %userName%

    9. Click on Save

    10. Click on Save Template

    11. To use this template,

      a. In single user creation, select it using the Selected Template option. 

      b. For bulk user creation, specify this template's name under the TemplateName header in the CSV file that contains the details for bulk user creation via ADManager Plus. 

 

NOTE: 

You can also run the custom script as a:

    1. VBScript using the cscript C:\dir1\scr.vbs%userName% format.

    2. Batch file using the scr.bat format (or scr.cmd format). 

Ensure that the path to the script file should not contain spaces if you are using naming formats like %userName%". In case you wish to use spaces in the path name or script name, use the '~' symbol to indicate spaces, in order to avoid erroneous results.  

 

For executing custom scripts upon successful user modification, click the User Modification templates in the AD Mgmt tab, and follow the steps mentioned above. 


                New to ADSelfService Plus?