# New-RASRDSHost

## NAME

New-RASRDSHost

## SYNOPSIS

Adds an RD Session Host server to a site.

## SYNTAX

**New-RASRDSHost** \[-[Server](#Server)] _\<string>_ \[\[-[SiteId](#SiteId)] _\<uint>_] \[-[AddUsersToRDSUsers](#AddUsersToRDSUsers) _\<string\[]>_] \[-[NoDesktopExperience](#NoDesktopExperience) _\<SwitchParameter>_] \[-[NoFireWallRules](#NoFireWallRules) _\<SwitchParameter>_] \[-[NoInstall](#NoInstall) _\<SwitchParameter>_] \[-[NoRestart](#NoRestart) _\<SwitchParameter>_] \[-[NoTerminalServices](#NoTerminalServices) _\<SwitchParameter>_] \[_<_[_CommonParameters_](#CommonParameters)_>_]

**New-RASRDSHost** \[-[Server](#Server)] _\<string>_ \[\[-[SiteId](#SiteId)] _\<uint>_] -[Password](#Password) _\<SecureString>_ -[Username](#Username) _\<string>_ \[-[AddUsersToRDSUsers](#AddUsersToRDSUsers) _\<string\[]>_] \[-[NoDesktopExperience](#NoDesktopExperience) _\<SwitchParameter>_] \[-[NoFireWallRules](#NoFireWallRules) _\<SwitchParameter>_] \[-[NoRestart](#NoRestart) _\<SwitchParameter>_] \[-[NoTerminalServices](#NoTerminalServices) _\<SwitchParameter>_] \[_<_[_CommonParameters_](#CommonParameters)_>_]

## DESCRIPTION

Adds an RD Session Host server to a site.

The RD Session Host agent will be installed on the server by default. You can optionally skip the agent installation by including the -NoInstall parameter.

## PARAMETERS

-**Server \<string>**\
A RD Session Host server FQDN or IP address.

```
        Required?                    true

        Position?                    0

        Default value                

        Accept pipeline input?       false

        Accept wildcard characters?  false
```

-**SiteId \<uint>**\
The site ID to which to add the specified server.

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

```
        Required?                    false

        Position?                    1

        Default value                0

        Accept pipeline input?       false

        Accept wildcard characters?  false
```

-**Username \<string>**\
An administrator account for push installing the RD Session Host agent on the server.

If this parameter is omitted, your RAS admin username (and password) will be used.

```
        Required?                    true

        Position?                    named

        Default value                

        Accept pipeline input?       false

        Accept wildcard characters?  false
```

-**Password \<SecureString>**\
The password of the account specified in the Username parameter.

```
        Required?                    true

        Position?                    named

        Default value                

        Accept pipeline input?       false

        Accept wildcard characters?  false
```

-**NoInstall \<SwitchParameter>**\
Specifies not to install the RD Session Host agent on the server.

If this parameter is omitted, the agent will be push installed on the server using your RAS admin credentials.

To specify different credentials for push installation, specify the Username and Password parameters.

```
        Required?                    false

        Position?                    named

        Default value                False

        Accept pipeline input?       false

        Accept wildcard characters?  false
```

-**NoRestart \<SwitchParameter>**\
Specifies not to restart the server after the RD Session Host agent is installed.

If this parameter is omitted, the server will be restarted if required.

```
        Required?                    false

        Position?                    named

        Default value                False

        Accept pipeline input?       false

        Accept wildcard characters?  false
```

-**NoFireWallRules \<SwitchParameter>**\
Specifies not to add firewall rules to allow the RDS Host Agent to communicate.

If this parameter is omitted, the firewall rules will not be added.

```
        Required?                    false

        Position?                    named

        Default value                False

        Accept pipeline input?       false

        Accept wildcard characters?  false
```

-**NoDesktopExperience \<SwitchParameter>**\
Specifies not to install the Desktop Experience after the RD Session Host agent is installed.

If this parameter is omitted, the Desktop Experience is installed.

```
        Required?                    false

        Position?                    named

        Default value                False

        Accept pipeline input?       false

        Accept wildcard characters?  false
```

-**NoTerminalServices \<SwitchParameter>**\
Specifies not to install the Terminal Services role after the RD Session Host agent is installed.

If this parameter is omitted, the Terminal Services role will be installed.

```
        Required?                    false

        Position?                    named

        Default value                False

        Accept pipeline input?       false

        Accept wildcard characters?  false
```

-**AddUsersToRDSUsers \<string\[]>**\
Specifies the list of users or groups in UPN or SID format to be added to the RDSUsers Group in csv format.

```
        Required?                    false

        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

[RDSHost](../classes-and-enumerations/rdshost)

## EXAMPLES

**---------- EXAMPLE 1 ----------**

New-RASRDSHost "server.company.dom"

Adds the specified RD Sessions Host server to the Licensing Server site (default).

The RD Session Host agent will be installed on the server using your RAS admin credentials (default).\
&#xNAN;**---------- EXAMPLE 2 ----------**

New-RASRDSHost -Server "server.company.dom" -SiteId 2 -Username "myname" -Password $pass

Adds the specified RD Session Host server to the specified site.

The -Username and -Password parameters specify credentials, which will be used to push install the RD Session Host agent on the server.\
&#xNAN;**---------- EXAMPLE 3 ----------**

New-RASRDSHost "server.company.dom" -NoInstall

Adds the specified RD Session Host server to the Licensing Server site (default).

The RD Session Host agent will not be installed on the server.

You can skip the agent installation if it's already installed on the server.

## RELATED LINKS

* [Get-RASRDSHost](get-rasrdshost)
* [Set-RASRDSHost](set-rasrdshost)
* [Remove-RASRDSHost](remove-rasrdshost)
