Hi @everybody,
Asked about this a while ago but didn't get it to work since then:
We are using templates for creating new users and we want to execute a simple powershell script.
Fresh installation: Server 2019 and ARM -> New database, new config.
According to the manual, scripts must be in C:\ProgramData\protected-networks.com\8MAN\scripts\analyze
This folder is being shared. The script is called nh.ps1. It works when executing in powershell on the ARM-server with of course fixed parameters for samaccountname etc...
Inside the template:
// 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",
// Path to the script file. Use UNC format and mention escaping.
"Path": "\\\\server\\analyze\\nh.ps1",
// (optional) Define the parameters that will be passed to the script.
"CommandLineParameters": "{samaccountname} {givenname} {sn}"
},
So, this one hands over the parameters to the powershell script which supposed to change the mailnickname.
Set-ADUser {samaccountname} -Replace @{MailNickName = <subst>(<tolowerCase>(<firstLetter>({givenname})).<tolowerCase>({sn}))
On executing the template, there is no error but also no immediate feedback via email whether the script execution suceeded.
After 2 hours, ARM reports the error.
[date time] __ [000] powershell.exe -inputformat none -File "\\server\analyze\nh.ps1" xxyy xx yy
(xxyy = samaccountname | givenname=xx | sn=yy )
What exactly does the error mean?
Not sure about how to read any logs. Any ideas what could be wrong?