This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Path of scripts

Hi,

We started testing some scripts again but it seems ARM is not executing them. They dont show up in the log.

In the manual it says:

Script must be stored in the following directory:

OLD: %programmData......

Not sure. Does OLD mean, not this path anymore  If yes, what is the new path for the scripts?

Nevertheless, the LOG displays executions of 2 external scripts when we used the former version 9. Now with the newest version of ARM, no log entries.

Thanks

  • Hi,

    Old mean when you had the 8MAN before, it will use the old path with protected-networks.com.

    When you do a clean new install, it will use the folder with solarwinds in it.

    If you selected a Collector (or several) for a ressource, the script needs to be on that (those) Collector server since it can't access the ARM server folders.

    Cheers

    Björn

  • Have to ask again .......

    Fresh Server 2019 and ARM installation now. The manual (still) says the scripts should be in  C:\ProgramData\protected-networks.com\8MAN\scripts\analyze.

    This folder is also being created during installation. There is a solarwinds folder but it only has Orion/Rabbit in it.

    The template is for new users + mailbox and it is suppossed to execute 'nh.ps1' which is just for setting the mailnickname.

    -> Set-ADUser {samaccountname} -Replace @{MailNickName = <subst>(<tolowerCase>(<firstLetter>({givenname})).<tolowerCase>({sn})) 

    Executing this script in powershell directly with fixed samaccount etc works (executed in powershell on the ARM-server). 

    Here the part:

     // Define scripting options. 
        "ScriptOptions" : {
            
            /* (optional) Hide the scripting area. Stronger than IsHiddenFromRequester.
            If a script is defined it will be executed even if the area is hidden. */ 
            "IsHidden"false,
            
            // (optional) Hide the scripting area for requesters in web interface. Weaker than IsHidden.
            "IsHiddenFromRequester"false,
            
            // (optional) Define the checkbox preset. Default is false (if not set).
            "IsScriptEnabledDefault"true,
            
            // Set a display name.
            "DisplayName""Set Alias and Homeshare",
            
            // Path to the script file. Use UNC format and mention escaping.
            "Path""\\\\arm-server.xxxlocal\\analyze\\nh.ps1",
            
            // (optional) Define the parameters that will be passed to the script.
            "CommandLineParameters""{samaccountname} {mail} {givenname} {sn}"
        },
     
    After a while (hours) ARM reports errors like this:
     

    [date time] __ [000] powershell.exe -inputformat none -File "\\arm-server....\analyze\nh.ps1" xxyy x.yy@mpdv.com xx yy

    xx = forename
    yy = surname
    xxyy = samaccountname

    Any ideas how to get the running? 

  • is what you posted the full script content? In powershell variables are referenced with a dollar sign (i.e. $variable) not with curly braces (those are only needed in the template). Also if you dont have any parameter declaration you will need to reference your variables using the $args variable.

    Also i would recommend to use a local path (i.e. C:\\temp\\nh.ps1) because if you are executing from a UNC path you will need different execution policies

    tip:

    when testing powershell scripts dont test by replacing variables with hardcoded values, test by passing the values over command line as it would be done by ARM itself

  • Oh, you're right. That folder did not change.

    I somehow got triggered by the old-part since a lot changed and there are some hints for that in the manual.

    The line you found with the errors is a print of what's going on in PowerShell, so it show you in the following lines what's going on and if there's an error.

    If I remember correctly the PowerShell runs in context of the user which is set for AD changes, so make sure that user is a local admin on the ARM server (unless a different collector is running it) and has the right privileges.