RDS provider + controller

This commit is contained in:
a.skorina 2014-11-10 11:14:15 +03:00
parent d01ec8ac44
commit 2e97811d33
21 changed files with 7552 additions and 117 deletions

View file

@ -130,6 +130,31 @@ namespace WebsitePanel.Providers.HostedSolution
return res;
}
public static bool IsComputerInGroup(string samAccountName, string group)
{
bool res = false;
DirectorySearcher deSearch = new DirectorySearcher
{
Filter =
("(&(objectClass=computer)(samaccountname=" + samAccountName + "))")
};
//get the group result
SearchResult results = deSearch.FindOne();
DirectoryEntry de = results.GetDirectoryEntry();
PropertyValueCollection props = de.Properties["memberOf"];
foreach (string str in props)
{
if (str.IndexOf(group) != -1)
{
res = true;
break;
}
}
return res;
}
public static string CreateOrganizationalUnit(string name, string parentPath)
{
string ret;

View file

@ -28,6 +28,9 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Net;
using System.Net.Sockets;
namespace WebsitePanel.Providers.RemoteDesktopServices
{
@ -36,6 +39,24 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
/// </summary>
public interface IRemoteDesktopServices
{
bool CreateCollection(string organizationId, RdsCollection collection);
RdsCollection GetCollection(string collectionName);
bool RemoveCollection(string organizationId, string collectionName);
bool SetUsersInCollection(string organizationId, string collectionName, List<string> users);
void AddSessionHostServerToCollection(string organizationId, string collectionName, RdsServer server);
void AddSessionHostServersToCollection(string organizationId, string collectionName, List<RdsServer> servers);
void RemoveSessionHostServerFromCollection(string organizationId, string collectionName, RdsServer server);
void RemoveSessionHostServersFromCollection(string organizationId, string collectionName, List<RdsServer> servers);
List<StartMenuApp> GetAvailableRemoteApplications(string collectionName);
List<RemoteApplication> GetCollectionRemoteApplications(string collectionName);
bool AddRemoteApplication(string collectionName, RemoteApplication remoteApp);
bool AddRemoteApplications(string collectionName, List<RemoteApplication> remoteApps);
bool RemoveRemoteApplication(string collectionName, RemoteApplication remoteApp);
bool AddSessionHostFeatureToServer(string hostName);
bool CheckSessionHostFeatureInstallation(string hostName);
bool CheckServerAvailability(string hostName);
}
}

View file

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
namespace WebsitePanel.Providers.RemoteDesktopServices
{
[Serializable]
public class RdsCollection
{
public RdsCollection()
{
Servers = new List<RdsServer>();
}
public int Id { get; set; }
public int ItemId { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public List<RdsServer> Servers { get; set; }
}
}

View file

@ -0,0 +1,8 @@
namespace WebsitePanel.Providers.RemoteDesktopServices
{
public class RdsCollectionPaged
{
public int RecordsCount { get; set; }
public RdsCollection[] Collections { get; set; }
}
}

View file

@ -0,0 +1,22 @@
using System.Net;
namespace WebsitePanel.Providers.RemoteDesktopServices
{
public class RdsServer
{
public int Id { get; set; }
public int? ItemId { get; set; }
public string Name
{
get
{
return string.IsNullOrEmpty(FqdName) ? string.Empty : FqdName.Split('.')[0];
}
}
public string FqdName { get; set; }
public string Description { get; set; }
public string Address { get; set; }
public string ItemName { get; set; }
public int? RdsCollectionId { get; set; }
}
}

View file

@ -0,0 +1,8 @@
namespace WebsitePanel.Providers.RemoteDesktopServices
{
public class RdsServersPaged
{
public int RecordsCount { get; set; }
public RdsServer[] Servers { get; set; }
}
}

View file

@ -0,0 +1,11 @@
namespace WebsitePanel.Providers.RemoteDesktopServices
{
public class RemoteApplication
{
public string Alias { get; set; }
public string DisplayName { get; set; }
public string FilePath { get; set; }
public string FileVirtualPath { get; set; }
public bool ShowInWebAccess { get; set; }
}
}

View file

@ -0,0 +1,11 @@
using System.Net;
namespace WebsitePanel.Providers.RemoteDesktopServices
{
public class SessionHostServer
{
public string Name { get; set; }
public string FqdName { get; set; }
public string Address { get; set; }
}
}

View file

@ -0,0 +1,9 @@
namespace WebsitePanel.Providers.RemoteDesktopServices
{
public class StartMenuApp
{
public string DisplayName { get; set; }
public string FilePath { get; set; }
public string FileVirtualPath { get; set; }
}
}

View file

@ -123,6 +123,13 @@
<Compile Include="OS\QuotaType.cs" />
<Compile Include="OS\SystemFilesPaged.cs" />
<Compile Include="RemoteDesktopServices\IRemoteDesktopServices.cs" />
<Compile Include="RemoteDesktopServices\RdsCollection.cs" />
<Compile Include="RemoteDesktopServices\RdsCollectionPaged.cs" />
<Compile Include="RemoteDesktopServices\RdsServer.cs" />
<Compile Include="RemoteDesktopServices\RdsServersPaged.cs" />
<Compile Include="RemoteDesktopServices\RemoteApplication.cs" />
<Compile Include="RemoteDesktopServices\SessionHostServer.cs" />
<Compile Include="RemoteDesktopServices\StartMenuApp.cs" />
<Compile Include="ResultObjects\HeliconApe.cs" />
<Compile Include="HostedSolution\ExchangeMobileDevice.cs" />
<Compile Include="HostedSolution\IOCSEdgeServer.cs" />