Skip to main content

Create a PowerShell-based Role

Summary

This document outlines the process of creating roles in ConnectWise Automate using PowerShell.

Process

  1. Navigate to System > Configuration > Dashboard

image

  1. Navigate to Config > Configurations > Role Definitions in System Dashboard.

image

  1. Create a simple PowerShell command that you want to use.

    Example

    (Get-NetAdapterBinding -Name '*' -ComponentID 'ms_tcpip6').Enabled

    Possible Output

    0 | 1

  2. Fill the appropriate information in role definition.

    Role: Name of the Role Type: Type of the Role. Sub-Type: Sub-Type of the Role if any. Applicable OS: Operating System where the role definition applies.

    Example

    Role: IPv6 Enabled Type: PowerShell Sub-Type: Role Applicable OS: Windows

    image

  3. Convert the PowerShell string into the Detection string to be used.

    Format: {%@C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -Command "<Command>"@%}

    Example: {%@C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -Command "(Get-NetAdapterBinding -Name '*' -ComponentID 'ms_tcpip6').enabled"@%}

  4. Paste the command in the Detection field. Set the appropriate operator and comparator.

    Example

    Detection: {%@C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -Command "(Get-NetAdapterBinding -Name '*' -ComponentID 'ms_tcpip6').enabled"@%} Operator: Equals Comparator: 1

    image

  5. Click the Add button to create the role.

    image

  6. Reload the system cache.

    image

  7. The role will take two to three hours to be detected on the computers.