New-RASNotificationScript
Last updated
Last updated
New-RASNotificationScript
Creates new notification script
New-RASNotificationScript - <string> - <string> [- <string>] [- <string>] [- <SecureString>] [- <uint>] [- <string>] [<>] New-RASNotificationScript - <SecureString> - <string> [<>]
A script can be attached to any of the notifications.
-Name <string> Script name.
-SiteId <uint> Site ID If the parameter is omitted, the site ID of the Licensing Server will be used.
-Command <string> Command to execute when invoked.
-Arguments <string> Command arguments. Possible values: ($CA), ($ENROLLMENTMETHOD), ($FARM-NAME), ($HOSTPOOL), ($LOCATION), ($NOTIFICATION-TIME), ($NOTIFICATION-TYPE), ($PROVIDER), ($RESOURCEGROUP), ($SERVER-ADDRESS), ($SITE-NAME), ($TENANTBROKER), ($TENANTNAME), ($THRESHOLD-DIRECTION), ($THRESHOLD-VALUE), ($TRIGGER-ADDRESS), ($WORKSPACE)
-InitialDirectory <string> Script base directory
-Username <string> Execute script as this system user.
-Password <SecureString> System user password.
<CommonParameters>
-none-
---------- EXAMPLE 1 ---------- New-RASNotificationScript -Name "scriptName" -Command "myscript.py" -Arguments "(`$HOSTPOOL) (`$CA)" -InitialDirectory "C:\" -Username "Administrator" Creates a new notification script which runs as 'Administrator' user. When 'Username' parameter is specified a password will be prompted. ---------- EXAMPLE 2 ---------- New-RASNotificationScript -Name "scriptName" -Command "myscript.py" -Arguments "(`$HOSTPOOL) (`$CA)" -InitialDirectory "C:\" -Username "Administrator" -Password (ConvertTo-SecureString -String "abc" -AsPlainText -Force) Creates a new notification script which runs as 'Administrator' user.