# New-RASNotificationScript

## NAME

New-RASNotificationScript

## SYNOPSIS

Creates new notification script.

## SYNTAX

**New-RASNotificationScript** -[Command](#command-string) *(string)* -[Name](#name-string) *(string)* \[[Arguments](#arguments-string) *(string)*] \[[InitialDirectory](#initialdirectory-string) *(string)*] \[[Password](#password-string) *(SecureString)*] \[[SiteId](#siteid-string) *(uint)*] \[[Username](#username-string) *(string)*] \[*(*[*CommonParameters*](#CommonParameters)*)*]

**New-RASNotificationScript** -[Password](#password-string) *(SecureString)* -[Username](#username-string) *(string)* \[*(*[*CommonParameters*](#CommonParameters)*)*]

## DESCRIPTION

A script can be attached to any of the notifications.

## PARAMETERS

## Name (string)

Script name.

```
        Required?                    true

        Position?                    named

        Default value                

        Accept pipeline input?       false

        Accept wildcard characters?  false
```

## SiteId (uint)

Site ID

If the parameter is omitted, the site ID of the Licensing Server will be used.

```
        Required?                    false

        Position?                    named

        Default value                0

        Accept pipeline input?       false

        Accept wildcard characters?  false
```

## Command (string)

Command to execute when invoked.

```
        Required?                    true

        Position?                    named

        Default value                

        Accept pipeline input?       false

        Accept wildcard characters?  false
```

## 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)

```
        Required?                    false

        Position?                    named

        Default value                

        Accept pipeline input?       false

        Accept wildcard characters?  false
```

## InitialDirectory (string)

Script base directory

```
        Required?                    false

        Position?                    named

        Default value                

        Accept pipeline input?       false

        Accept wildcard characters?  false
```

## Username (string)

Execute script as this system user.

```
        Required?                    true

        Position?                    named

        Default value                

        Accept pipeline input?       false

        Accept wildcard characters?  false
```

## Password (SecureString)

System user password.

```
        Required?                    true

        Position?                    named

        Default value                

        Accept pipeline input?       false

        Accept wildcard characters?  false
```

(CommonParameters)

```
        This cmdlet supports the common parameters: Verbose, Debug,

        ErrorAction, ErrorVariable, WarningAction, WarningVariable,

        OutBuffer, PipelineVariable, and OutVariable. For more information, see 

        about_CommonParameters documentation. 
```

## INPUTS

-none-

## OUTPUTS

[NotificationScript](https://docs.parallels.com/landing/ras-powershell-api-guide/parallels-ras-powershell-admin-module/types/notificationscript)

## EXAMPLES

**---------- 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.\
\&#xNAN;**---------- 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.

## RELATED LINKS

* [Get-RASNotificationScript](https://docs.parallels.com/landing/ras-powershell-api-guide/parallels-ras-powershell-admin-module/commands/get-rasnotificationscript)
* [Set-RASNotificationScript](https://docs.parallels.com/landing/ras-powershell-api-guide/parallels-ras-powershell-admin-module/commands/set-rasnotificationscript)
* [Remove-RASNotificationScript](https://docs.parallels.com/landing/ras-powershell-api-guide/parallels-ras-powershell-admin-module/commands/remove-rasnotificationscript)
