RDS Sample



Logon

Request
POST api/Session/logon
Headers
Content-Type: application/json; api-version=1.0
Body
{
  "username":"administrator",
  "password":"11112222"
}


Response
Status:OK (200)
{
  "authToken": "[AUTHENTICATION_TOKEN]"
}


Get All RDS Servers

Request
GET api/rds
Headers
Content-Type: application/json; api-version=1.0
auth_token: [AUTHENTICATION_TOKEN]


Response
Status:OK (200)
[
  {
    "directAddress": "rds.trtr.co.mt",
    "rasTemplateId": 0,
    "inheritDefaultAgentSettings": true,
    "inheritDefaultPrinterSettings": true,
    "inheritDefaultUPDSettings": true,
    "inheritDefaultDesktopAccessSettings": true,
    "port": 3389,
    "maxSessions": 250,
    "sessionTimeout": 25,
    "sessionLogoffTimeout": 0,
    "allowURLAndMailRedirection": 1,
    "allowRemoteExec": true,
    "enableAppMonitoring": true,
    "useRemoteApps": false,
    "allowFileTransfer": true,
    "allowDragAndDrop": true,
    "preferredPAId": 0,
    "enablePrinting": true,
    "enableTWAIN": true,
    "enableWIA": false,
    "printerNameFormat": 0,
    "removeClientNameFromPrinterName": false,
    "removeSessionNumberFromPrinterName": false,
    "updMode": 0,
    "maxUserProfileDiskSizeGB": 20,
    "diskPath": "\\\\server\\upd-path",
    "roamingMode": 0,
    "includeFolderPath": [],
    "includeFilePath": [],
    "excludeFolderPath": [],
    "excludeFilePath": [],
    "restrictDesktopAccess": false,
    "restrictedUsers": [],
    "server": "rds.trtr.co.mt",
    "enabled": false,
    "description": "",
    "siteId": 1,
    "id": 361
  }
]


Create RDS Server

Request
POST api/rds?noinstall=true
Headers
Content-Type: application/json; api-version=1.0
auth_token: [AUTHENTICATION_TOKEN]


Response
Status:Created (201)
{
  "directAddress": "rds.company.dom",
  "rasTemplateId": 0,
  "inheritDefaultAgentSettings": true,
  "inheritDefaultPrinterSettings": true,
  "inheritDefaultUPDSettings": true,
  "inheritDefaultDesktopAccessSettings": true,
  "port": 3389,
  "maxSessions": 250,
  "sessionTimeout": 25,
  "sessionLogoffTimeout": 0,
  "allowURLAndMailRedirection": 1,
  "allowRemoteExec": true,
  "enableAppMonitoring": true,
  "useRemoteApps": false,
  "allowFileTransfer": true,
  "allowDragAndDrop": true,
  "preferredPAId": 0,
  "enablePrinting": true,
  "enableTWAIN": true,
  "enableWIA": false,
  "printerNameFormat": 0,
  "removeClientNameFromPrinterName": false,
  "removeSessionNumberFromPrinterName": false,
  "updMode": 0,
  "maxUserProfileDiskSizeGB": 20,
  "diskPath": "\\\\server\\upd-path",
  "roamingMode": 0,
  "includeFolderPath": [],
  "includeFilePath": [],
  "excludeFolderPath": [],
  "excludeFilePath": [],
  "restrictDesktopAccess": false,
  "restrictedUsers": [],
  "server": "rds.company.dom",
  "enabled": true,
  "description": "",
  "siteId": 1,
  "id": 362
}


Apply Settings

Request
POST api/Settings/Apply
Headers
Content-Type: application/json; api-version=1.0
auth_token: [AUTHENTICATION_TOKEN]


Response
Status:No Content (204)


Get RDS Status

Request
GET api/rds/361/status
Headers
Content-Type: application/json; api-version=1.0
auth_token: [AUTHENTICATION_TOKEN]


Response
Status:OK (200)
{
    "preferredPA": "MC2019",
    "activeSessions": 1,
    "disconnectedSessions": 0,
    "activeConnections": 1,
    "ip": "0.0.0.0",
    "loginStatus": 0,
    "updStatus": 2,
    "cpuLoad": 23,
    "memLoad": 48,
    "diskRead": 10,
    "diskWrite": 0,
    "enabled": true,
    "id": "361",
    "server": "172.30.10.20",
    "siteId": 1,
    "agentVer": "17.0 (build 21257)",
    "serverOS": "Windows Server 2019 Standard Edition (WOW 64)",
    "serviceStartTime": "Wed May 15 09:34:08 2019",
    "systemBootTime": "Tue May 14 09:30:56 2019",
    "unhandledExceptions": 0,
    "agentState": 0,
    "serverType": 1,
    "logLevel": 3
}


Get RDS Sessions

Request
GET api/rds/sessions
Headers
Content-Type: application/json; api-version=1.0
auth_token: [AUTHENTICATION_TOKEN]


Response
Status:OK (200)
[
    {
        "sessionID": 1,
        "type": 7,
        "state": 5,
        "protocol": 2,
        "user": "Administrator",
        "ip": "0.0.0.0",
        "serverID": 361,
        "themeID": 0,
        "logonTime": "2019-05-07T09:19:59",
        "deviceName": "DESKTOP",
        "idleStartTime": "2019-05-29T09:02:38",
        "verticalResolution": 1080,
        "horizontalResolution": 1920,
        "colourDepth": 32
    },
    {
        "sessionID": 2,
        "type": 7,
        "state": 5,
        "protocol": 2,
        "user": "Administrator",
        "ip": "0.0.0.0",
        "serverID": 361,
        "themeID": 0,
        "logonTime": "2019-05-07T09:54:01",
        "deviceName": "Bill PC",
        "idleStartTime": "2019-05-27T13:10:46",
        "verticalResolution": 855,
        "horizontalResolution": 1404,
        "colourDepth": 32
    }
]


Create RDS Group

Request
POST api/rdsgroups
Headers
Content-Type: application/json; api-version=1.0
auth_token: [AUTHENTICATION_TOKEN]
Body
{
  "name":"NewGroupOfRds"
}


Response
Status:Created (201)
{
  "rdsDefSettings": {
    "port": 3389,
    "maxSessions": 250,
    "sessionTimeout": 25,
    "sessionLogoffTimeout": 0,
    "allowURLAndMailRedirection": 1,
    "preferredPAId": 0,
    "allowRemoteExec": true,
    "enableAppMonitoring": true,
    "useRemoteApps": false,
    "allowFileTransfer": true,
    "allowDragAndDrop": true,
    "enablePrinting": true,
    "enableTWAIN": true,
    "enableWIA": false,
    "printerNameFormat": 0,
    "removeClientNameFromPrinterName": false,
    "removeSessionNumberFromPrinterName": false,
    "updMode": 0,
    "maxUserProfileDiskSizeGB": 20,
    "diskPath": "\\\\server\\upd-path",
    "roamingMode": 0,
    "includeFolderPath": [],
    "includeFilePath": [],
    "excludeFolderPath": [],
    "excludeFilePath": [],
    "restrictDesktopAccess": false,
    "restrictedUsers": []
  },
  "name": "NewGroupOfRds",
  "siteId": 1,
  "enabled": true,
  "description": "",
  "useRASTemplate": false,
  "rasTemplateId": 0,
  "workLoadThreshold": 75,
  "serversToAddPerRequest": 1,
  "maxServersFromTemplate": 2,
  "workLoadToDrain": 20,
  "inheritDefaultAgentSettings": true,
  "inheritDefaultPrinterSettings": true,
  "inheritDefaultUPDSettings": true,
  "inheritDefaultDesktopAccessSettings": true,
  "rdsIds": [],
  "id": 160
}


Add RDS Server to Group

Request
POST api/rdsgroups/161/Members
Headers
Content-Type: application/json; api-version=1.0
auth_token: [AUTHENTICATION_TOKEN]
Body
{
  "rdsids": [363] 
}


Response
Status:Created (201)


Update RDS Group

Request
PUT api/rdsgroups/161
Headers
Content-Type: application/json; api-version=1.0
auth_token: [AUTHENTICATION_TOKEN]
Body
{
  "newname":"AnotherRdsGroup",
  "description":"another_group_of_servers"
}


Response
Status:NoContent (204)


LogOff

Request
POST api/Session/logoff
Headers
Content-Type: application/json; api-version=1.0
auth_token: [AUTHENTICATION_TOKEN]


Response
Status:OK (200)