DCImanager uses PowerShell to run Windows recipes. The full name of the executed file is %windir%\System32\WindowsPowerShell\v1.0\powershell.exe.
This information is only for Windows Server 2016.
For correct operation of recipes use the latest OS template.
Script start algorithm
-
The macro $HAS_RECIPE is checked. It is executed in the response file for Windows installations /DCI/ISPsystem__Windows Server 2016/Unattend.xml. If the value equals 1, remote execution of scripts is allowed on the server: the script winrm_listener.ps1 is started.
Full name/DCI/ISPsystem__Windows Server 2016/win2016/sources/$OEM$/$$/SETUP/SCRIPTS/winrm_listener.ps1
-
The recipe file is uploaded to the server by the URL from the macros $AFTER_INSTALL_SCRIPT_HTTPS.
URL formathttps://mydci.com:1500/dcimgr?func=osinstall.afterscript&id=randId
Details - The script is executed.
-
The option that allows executing scripts remotely is disabled automatically with the script winrm_disabler.ps1:
Full name/usr/local/mgr5/etc/winrm_disabler.ps1
OS installation parameters
General information about OS installation is kept in the file /usr/local/mgr5/var/operations/operId.server_os_install. For example, what OS template or password was used. The values of the macros $HAS_RECIPE and $AFTER_INSTALL_SCRIPT_HTTPS that was used for OS installation are kept in /usr/local/mgr5/var/operations/operId.server_os_install.params.
Logs
The script executions logs are added to /usr/local/mgr5/var/runrecipe_dci.log. To save script execution results increase the logging level to 9 for the modules runrecipe, dci_osinstall, dci_operations. To do so, add the following records to /usr/local/mgr5/etc/debug.conf:
.*runrecipe_dci 9
.*dci_osinstall 9
.*dci_operations 9