What IDM variables and data can be used in a powershell script?

Hello,

We are trying to generate a powershell script with data from IDM such as Email and username.  How do we know what variables are available from IDM to be included in the powershell script?  Is there any documentation regarding this?

  • There is a lot missing from your post, such as where this is meant to occur in the product, what the use case is, version of the product, etc...

    If its a Sync Project, the Connector Definition defines what attributes are sent to the function (plus adding whatever params that function needs).

    If its a Process there are two ways:

    1. "Execute Command Line" (designed for existing modules) = command + params - params can be any treewalker/query
    2. "Execute Script" = build the whole script using something like a StringBuilder and that command block is executed - nested values can be any treewalker/query

    If its something else, you will need to enlighten us.

  • If you are planning to build a connector using sync editor, below one-identity powershell connector guides will be very useful

    https://github.com/OneIdentity/IdentityManager.PoSh-Connector-Guide
    https://github.com/OneIdentity/IdentityManager.PoSh

  • Thank you for the input, sorry for the delay as I was on vacation.  What we would like to do is, when a user matches a specific group or title, during the identity creation process, call a servicenow API to start a robotics (RPA) process that would enroll or disenroll a user in applications that don't support any other method of automation.  An example of that call would be below.  In this example, we are passing the username and email address of the identity to the bot through a param in the URL.  The Bot can then use this information to enroll the user in the application.

    subscription.service-now.com/api/test/test_rpa_bot_call01?username=David&email=email@emaildomain.com

    What we are trying to figure out is how to get those username and email (or any other properties) directly from IDM dynamically when the call is made.

  • Are you planning to integrate with ServiceNow using a custom PowerShell Sync project or using VB.NET Code and Web Services, or Process with PowerShell command? Each way has its own challenges.

    The latter option might be easiest to handle the conditions you require. So, a process step for PowerShell Script on the Person table might have something like:

    Dim psScript As New System.Text.StringBuilder
    psScript.AppendLine("$snURL = ""https://subscription.service-now.com/api/test/test_rpa_bot_call01?username=" & HttpUtility.UrlEncode($CentralAccount$) & "&email=" & HttpUtility.UrlEncode($DefaultEmailAddress$) & """;")
    psScript.AppendLine("# Something to auth...");
    psScript.AppendLine("try {");
    psScript.AppendLine("   $result = Invoke-RestMethod -Url $snURL -param $value -param $value;");
    psScript.AppendLine("   Return $true;");
    psScript.AppendLine("}");
    psScript.AppendLine("catch {");
    psScript.AppendLine("   Throw((""Exception: {0}"" -F $_));");
    psScript.AppendLine("}");
    Return psScript.ToString()

  • I don't know that we plan to interact with service now at all beyond the URL that starts the bot process.  Once we make that call with the proper parameters, it should start the robotic process.  So its more of a set it and forget it type option.