SDP API - Onboarding/Offboarding with Powershell

SDP API - Onboarding/Offboarding with Powershell

I created a couple small and quick powershell scripts to automate onboarding/offboarding requests in SDP for new hires and terminations. They create/delete ActiveDirectory user accounts, and close/create other tickets as examples related to common onboarding/offboarding process. In addition to SDP API calls, they use native AD powershell commands, as well as ADManagerPlus API calls.

In our environment, new employees are created by submitting a new user template with multiple required fields filled out. Existing employees are termed thru a ticket that's emailed from our payroll system to the helpdesk ticketing system, that includes limited but standard information for each employee. So you'll see a different approach in each script to gathering the data necessary to automate these tasks.

I wrote these scripts to avoid some barriers identified when trying to do so within the native rules/automation included in ServiceDeskPlus.

The scripts are attached here as text files, and are heavily commented to explain progression of logic. They would need renamed to ps1 extension and customized to your needs. They were created and tested with Powershell5.1, and RSAT/AD module for powershell available.

I have these scripts set to run as scheduled tasks, so they are checking every few minutes for tickets to process.

You'll need an API key created for your technician account in SDP, and you'll need to use the ADMP API to get an authticket to use the ADMP API. Once you have that, you can update the top few lines of each script with that info.

These were created from scratch, in a hurry, and they are being shared as-is with that in mind. Hopefully some find them as helpful starting points for their own needs. Admittedly these were not designed for elegance - the scripting here is not an example of best practices to aspire towards. But they are the fastest solution I came to that meets my needs, and they work for me. Maybe they can work for others as well with some slight adjustments.

If any of you have your own quick powershell scripts using ManageEngine API's, I'd be interested in seeing them.

                  New to ADSelfService Plus?