New-RASNotificationScript
Creates new notification script.
New-RASNotificationScript -Command <string> -Name <string> [-Arguments <string>] [-InitialDirectory <string>] [-Password <SecureString>] [-SiteId <uint>] [-Username <string>] [<CommonParameters>]
New-RASNotificationScript -Password <SecureString> -Username <string> [<CommonParameters>]
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.