# RAS Agent Example

{% code fullWidth="true" %}

```powershell
#Establish a connection with Parallels RAS (Replace Administrator with your RAS root account). 
New-RASSession Administrator
#Adding two RAS RDSs 
New-RASRDS -Server "rds1.company.dom" -Username administrator
New-RASRDS -Server "rds2.company.dom" -Username administrator
#Apply all settings. This cmdlet performs the same action as the Apply button in the RAS console. 
Invoke-RASApply
# Get all available RAS Agents information
Get-RASAgent

ID      Site ID         Server              Type             State            Agent Version         Server OS              
--      ------          ------              ----------       ----------       --------         	    --------              
1            1          broker.company.dom      BROKER               OK       16.1 (build 1... 	    Microsoft Win...      
1            1          rds1.company.dom           RDS               OK       16.1 (build 1... 	    Microsoft Win...      
1            1          gw.company.dom         Gateway      NotVerified                        	                          
2            1          rds2.company.dom           RDS               OK       16.1 (build 1...      Microsoft Win...
					

# Get the RAS Agent information (by server name 'rds1.company.dom') 
Get-RASAgent -Server rds1.company.dom | Format-Table

ID      Site ID         Server              Type            State  	           Agent Version      	Server OS
--      ------          ------              ----------      ----------  	   --------         	--------
1            1          rds1.company.dom           RDS              OK  	   16.1 (build 1... 	Microsoft Win...
					

#Update RDS RAS Agent (by input object)
$rdsAgent = Get-RASAgent -Server rds1.company.dom
Update-RASAgent -InputObject $rdsAgent -Username administrator
#Update RDS RAS Agent (by server name 'rds2.company.dom') 
Update-RASAgent -Server rds2.company.dom -Username administrator
# Get all RAS Agents information of type RDS 
Get-RASAgent -ServerType RDS | Format-Table

ID      Site ID         Server                Type            State    	        Agent Version       Server OS                      
--      ------          ------                ----------      ----------    	--------         	--------                      
1            1          rds1.company.dom             RDS              OK    	16.1 (build 1... 	Microsoft Win...              
2            1          rds2.company.dom             RDS              OK    	16.1 (build 1... 	Microsoft Win...              
					

# Removing RAS Agent (by server name 'rds2.company.dom') 
Remove-RASAgent -Server rds2.company.dom -Username administrator
#Apply all settings. This cmdlet performs the same action as the Apply button in the RAS console. 
Invoke-RASApply
# Get all available RAS Agents information
Get-RASAgent

ID      Site ID         Server               Type             State            Agent Version         	Server OS              
--      ------          ------               ----------       ----------       --------         	    --------              
1            1          broker.company.dom       BROKER       OK               16.1 (build 1... 	    Microsoft Win...      
1            1          rds1.company.dom         RDS          OK               16.1 (build 1... 	    Microsoft Win...      
1            1          gw.company.dom           Gateway      NotVerified                        	                          
					

#End the current RAS session.
Remove-RASSession
```

{% endcode %}
