How to do a "Hello World!" in Identity Manager scripting?

Hello,

i am finished master student of computer science and certified IAM-Consultant but totally beginner in 1IM scripting and .NET.

How to do a "Hello World!" in a script in 1IM?

Thanks

  • Hello Michael,

    Here is an example script in VB Net, which is the language that 1IM uses for scripts, remembering that 1IM scripts are usually used in processes, often used as functions, and also called in the IT Shop:

    ' Function Without Return

    Public Sub Hello_world()
         MessageBox("Hello World")
    End Sub

    ' Function with Return

    Public Function Hello_World() As String

        Return "Hello World"

    End Function

  • Also in the installation folder in the following path:

    Modules\QBM\dvd\AddOn\SDK\ScriptSamples

    You can find several examples of scripts to do specific things in 1IM

  • There is a lot of content on our YouTube channel as well. The video series about scripting might be of interest.

    https://www.youtube.com/playlist?list=PL242czeZwlAk0T2AcqpSFtBOXQfkP9f5J

  • Thanks for your help.

      Thanks for providing example code

    Thanks for providing this video-series. I have not seen all of your videos but for this moment of my journey i can not use them because they are to high-level. They start with the scripting itselfe without telling how to actually set up a script and execute it. maybe i can use your videos in some weeks but for this moment i need more basic knowledge.

    Based on your information and what i have learned in IAM-Certification i have written a detailed tutorial. But i am stuck after k). Maybe you can help me with that.

    Hello World! in Identity Manager Tutorial

    a) Open the Designer-Tool of One Identity.
    b) Check Version of Designer at Help -> Info. This instruction was written for 9.1. If your version differs, some details may differ. Close the "About" ( Help -> Info ) windows with "Done".
    c) Script Library is used to manage scripts. Click on "Script Library" in the left bottom.
    d) In the "Navigation" view on the left top expand and click on "Customscripts".
    e) Click on "create a new script" on the right top.
    f) Type "CCC_HelloWorld" as the name of the script, next to the label "Script". CCC is used as a prefix of custom scripts. It is a non obligatory but should convention to do so, to seperate custom scripts from system scripts.
    g) You may want to type a description of your script in the corresponding box. This is important if you do complicated scripts in future. For this time we can skip this.
    h) Identity Manager uses VB.Net code in scripts. Copy the following code into the big text box in the middle of your screen, which is meant to receive the scriptcode.
    ### Copy after this line excluding this line ###

    ' Function Without Return
    
    Public Sub Hello_world()
         MessageBox("Hello World")
    End Sub
    
    ' Function with Return
    
    Public Function Hello_World() As String
    
        Return "Hello World"
    
    End Function

    ### Copy before this line excluding this line ###
    i) In this code there are 2 procedures/methods/entry points/functions implemented. Either someone could call the Sub "Hello_world()" and will get a messagebox promted on the screen, or somebody could call the Function "Hello_world()" which will return a String with the content "Hello World".
    j) Click on the save botton on the middle top of your screen or in the Menu Script -> Save.
    k) Right click on the Navigation section and use Refresh view. Now you should see your new script listed below Customscripts.

    1) Now i am stuck a this point. How to execute?

    In tab "Test script" the "Run"-Button is greyed out. And who is actually calling the methods? There is no main entry point to this class/script/code which may be called from outside. So this is only a file this contains functions that have to be executed from outside. Where to do that?

    2) The above style of example (a-k) is what i expect to be like when we talk about a tutorial. It says what we need to do/click/code and provides some background information for better unterstanding. Do you know tutorials of this style for scripting in Identity Manager? This is a very basic example. But for connecting, accessing and altering the database the script may become much more complicated (i don't know). Thus a detailed explanation of the used functions and their parameters would be great. For example in a tutorial or in a API. Is there a developer API for Identity Manager scripting?

    Michael Gattinger

  • Okay i think next step would be to (locally) compile the script with the icon on top middle or Script -> Compile script or F9. Then 2 compile errors appear. I have fixed them (Functions names should differ, MessageBox -> MsgBox) and compiled again. But at "Test script" the "Run"-Button is still greyed out.

    Michael Gattinger