Remote applications - several session hosts

This commit is contained in:
vfedosevich 2015-02-02 04:22:44 -08:00
parent d063e2ce2d
commit 7e8390d298
8 changed files with 243 additions and 15 deletions

View file

@ -184,6 +184,35 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
#region RDS Collections
public List<string> GetRdsCollectionSessionHosts(string collectionName)
{
var result = new List<string>();
Runspace runspace = null;
try
{
runspace = OpenRunspace();
Command cmd = new Command("Get-RDSessionHost");
cmd.Parameters.Add("CollectionName", collectionName);
cmd.Parameters.Add("ConnectionBroker", ConnectionBroker);
object[] errors;
var hosts = ExecuteShellCommand(runspace, cmd, false, out errors);
foreach (var host in hosts)
{
result.Add(GetPSObjectProperty(host, "SessionHost").ToString());
}
}
finally
{
CloseRunspace(runspace);
}
return result;
}
public bool AddRdsServersToDeployment(RdsServer[] servers)
{
var result = true;