# New-RASNotificationScript

### NAME

New-RASNotificationScript\ <br>

### SYNOPSIS

Creates new notification script\ <br>

### SYNTAX

New-RASNotificationScript -[Command](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASNotificationScript.html#Command) *\<string>* -[Name](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASNotificationScript.html#Name) *\<string>* \[-[Arguments](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASNotificationScript.html#Arguments) *\<string>*] \[-[InitialDirectory](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASNotificationScript.html#InitialDirectory) *\<string>*] \[-[Password](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASNotificationScript.html#Password) *\<SecureString>*] \[-[SiteId](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASNotificationScript.html#SiteId) *\<uint>*] \[-[Username](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASNotificationScript.html#Username) *\<string>*] \[*<*[*CommonParameters*](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASNotificationScript.html#CommonParameters)*>*]\
\
New-RASNotificationScript -[Password](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASNotificationScript.html#Password) *\<SecureString>* -[Username](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASNotificationScript.html#Username) *\<string>* \[*<*[*CommonParameters*](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASNotificationScript.html#CommonParameters)*>*]\ <br>

### DESCRIPTION

A script can be attached to any of the notifications.\ <br>

### PARAMETERS

\
-**Name \<string>**\
Script name.\ <br>

```
        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.\ <br>

```
        Required?                    false
```

```
        Position?                    named
```

```
        Default value                0
```

```
        Accept pipeline input?       false
```

```
        Accept wildcard characters?  false
```

\
-**Command \<string>**\
Command to execute when invoked.\ <br>

```
        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)\ <br>

```
        Required?                    false
```

```
        Position?                    named
```

```
        Default value                
```

```
        Accept pipeline input?       false
```

```
        Accept wildcard characters?  false
```

\
-**InitialDirectory \<string>**\
Script base directory\ <br>

```
        Required?                    false
```

```
        Position?                    named
```

```
        Default value                
```

```
        Accept pipeline input?       false
```

```
        Accept wildcard characters?  false
```

\
-**Username \<string>**\
Execute script as this system user.\ <br>

```
        Required?                    true
```

```
        Position?                    named
```

```
        Default value                
```

```
        Accept pipeline input?       false
```

```
        Accept wildcard characters?  false
```

\
-**Password \<SecureString>**\
System user password.\ <br>

```
        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 . 
```

<br>

### INPUTS

-none-

### OUTPUTS

[NotificationScript](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/types/NotificationScript.html)

### EXAMPLES

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.parallels.com/landing/ras-powershell-api-guide/v19/parallels-ras-powershell-admin-module/commands/new-rasnotificationscript.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
