Use PowerShell with au2mator

Last modified: August 9, 2021
You are here:
Estimated reading time: 2 min

Setting Information

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
  • Your Script
    • That’s is your Magic, and absolutely up to you
  • Return
    • 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

  • User.Read
  • User.ReadWrite
  • User.ReadBasic.All
  • User.Read.All
  • User.ReadWrite.All
  • GroupMember.Read.All
  • Directory.AccessAsUser.All
  • Channel.ReadBasic.All
  • ChannelSettings.Read.All
  • ChannelSettings.ReadWrite.All
  • Group.Read.All
  • Group.ReadWrite.All
  • Directory.Read.All
  • Directory.ReadWrite.All
  • ChannelMessage.Send
  • Chat.Create
  • Chat.ReadWrite
  • ChatMessage.Send
  • Chat.ReadWrite

You then can send Teams Adaptive Cards instead of Emails as Service Status to User or Channel

Something More

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.

Was this article helpful?
Dislike 1

Title