This article will describe how you can connect au2mator to your PowerShell File, Configure your PowerShell Service, and some other details on using PowerShell with au2mator.
Configure PowerShell with au2mator
To enable the PowerShell Automation Engine in au2mator Self Service Portal, you have to configure a file share in au2mator, where your PowerShell Files are stored.
You have to configure the root Folder of that Store. In there, you can create SubFolder as you need it.
- Login as Admin
- Navigate to Settings
- Click on Automation
- Scroll down to PowerShell Scripting
- Enter a file Path, which is located on the au2mator Server
- Make sure the IIS App Pool Service User has full Access to this Folder
- Create your PS1 File in this Folder or Subfolder
Write a PowerShell Script to work with au2mator
There are only a few things you need to take care of when writing a ps1 File to work with au2mator, but all of them are PowerShell Best Practice, so you should usually be able to use your existing Script within Seconds.
IMPORTANT: Since au2mator 4.0, PowerShell Scripts will run in 7.0 Core Context, so make sure your PowerShell Scripts are PS7 ready.
There are three essential Parts
- Input Parameters
- This is used as your Questions in au2mator
- Take a note of our “Built-in Initialize Data”
- Your Script
- That’s is your Magic, and absolutely up to you
- with the Return function, you can write values back to au2mator, which shown in the Service Details
That’s all. Everything else is up to you, how you format your PowerShell, and what your PowerShell is doing.
See our free and “read to au2mate” PowerShell Scripts on GitHub.
Get our au2mator PS Template to start with Automation: au2mator PS Template on GitHub.
Create a Service with PowerShell
Now it is time for the exciting Part, Self Service, and delegate your PowerShell Script with au2mator.
Make sure you have configured at least one Service Group before.
- Login as Admin
- Navigate to Services
- Click on +New
- Enter Name, Description and select a Service Group
- Navigate to Automation
- Select PowerShell
- Select your PS1 File from the List as New Request Runbook
- Navigate to Questions and configure your Questions as needed
Azure App Reg for Teams Card send
This is in Template v1.4 and above.
We use the TeamsCreds.xml from here for this: PowerShell Credentials – au2mator – Self Service Portal
Create an Azure App Registration with the following “Delegated MS GRAPH API” Permissions
You then can send Teams Adaptive Cards instead of Emails as Service Status to User or Channel
PowerShell Feature is available since Version 3.8
The PowerShell script is executed under the au2mator Application Pool User Context. Make sure this user can proceed with all your actions in the PowerShell Script or switch the User Context in PowerShell to achieve this.