Update_DB RDS tables fix
This commit is contained in:
parent
8cc464668a
commit
c0fecdcf33
5 changed files with 18 additions and 27 deletions
|
@ -5428,9 +5428,7 @@ GO
|
|||
/*Remote Desktop Services*/
|
||||
|
||||
/*Remote Desktop Services Tables*/
|
||||
IF EXISTS (SELECT * FROM SYS.TABLES WHERE name = 'RDSCollectionUsers')
|
||||
DROP TABLE RDSCollectionUsers
|
||||
GO
|
||||
IF NOT EXISTS (SELECT * FROM SYS.TABLES WHERE name = 'RDSCollectionUsers')
|
||||
CREATE TABLE RDSCollectionUsers
|
||||
(
|
||||
ID INT IDENTITY(1,1) NOT NULL PRIMARY KEY,
|
||||
|
@ -5440,9 +5438,7 @@ CREATE TABLE RDSCollectionUsers
|
|||
GO
|
||||
|
||||
|
||||
IF EXISTS (SELECT * FROM SYS.TABLES WHERE name = 'RDSServers')
|
||||
DROP TABLE RDSServers
|
||||
GO
|
||||
IF NOT EXISTS (SELECT * FROM SYS.TABLES WHERE name = 'RDSServers')
|
||||
CREATE TABLE RDSServers
|
||||
(
|
||||
ID INT IDENTITY(1,1) NOT NULL PRIMARY KEY,
|
||||
|
@ -5456,9 +5452,7 @@ CREATE TABLE RDSServers
|
|||
GO
|
||||
|
||||
|
||||
IF EXISTS (SELECT * FROM SYS.TABLES WHERE name = 'RDSCollections')
|
||||
DROP TABLE RDSCollections
|
||||
GO
|
||||
IF NOT EXISTS (SELECT * FROM SYS.TABLES WHERE name = 'RDSCollections')
|
||||
CREATE TABLE RDSCollections
|
||||
(
|
||||
ID INT IDENTITY(1,1) NOT NULL PRIMARY KEY,
|
||||
|
|
|
@ -284,6 +284,7 @@ namespace WebsitePanel.EnterpriseServer
|
|||
catch (Exception ex)
|
||||
{
|
||||
result.AddError("REMOTE_DESKTOP_SERVICES_ADD_RDS_COLLECTION", ex);
|
||||
throw TaskManager.WriteError(ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
|
|
@ -213,26 +213,26 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
}
|
||||
|
||||
public bool CreateCollection(string organizationId, RdsCollection collection)
|
||||
{
|
||||
{
|
||||
var result = true;
|
||||
|
||||
Runspace runSpace = null;
|
||||
|
||||
try
|
||||
{
|
||||
runSpace = OpenRunspace();
|
||||
{
|
||||
runSpace = OpenRunspace();
|
||||
|
||||
foreach (var server in collection.Servers)
|
||||
{
|
||||
//If server will restart it will not be added to collection
|
||||
//Do not install feature here
|
||||
//Do not install feature here
|
||||
|
||||
if (!ExistRdsServerInDeployment(runSpace, server))
|
||||
{
|
||||
AddRdsServerToDeployment(runSpace, server);
|
||||
{
|
||||
AddRdsServerToDeployment(runSpace, server);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Command cmd = new Command("New-RDSessionCollection");
|
||||
cmd.Parameters.Add("CollectionName", collection.Name);
|
||||
cmd.Parameters.Add("SessionHost", collection.Servers.Select(x => x.FqdName).ToArray());
|
||||
|
@ -243,7 +243,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
cmd.Parameters.Add("CollectionDescription", collection.Description);
|
||||
}
|
||||
|
||||
var collectionPs = ExecuteShellCommand(runSpace, cmd, false).FirstOrDefault();
|
||||
var collectionPs = ExecuteShellCommand(runSpace, cmd, false).FirstOrDefault();
|
||||
|
||||
if (collectionPs == null)
|
||||
{
|
||||
|
@ -293,11 +293,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
{
|
||||
AddComputerToCollectionAdComputerGroup(organizationId, collection.Name, rdsServer);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
result = false;
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
CloseRunspace(runSpace);
|
||||
|
@ -934,7 +930,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
runSpace = OpenRunspace();
|
||||
var feature = AddFeature(runSpace, hostName, "RDS-RD-Server", true, true);
|
||||
installationResult = (bool)GetPSObjectProperty(feature, "Success");
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
CloseRunspace(runSpace);
|
||||
|
@ -1425,10 +1421,10 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
if (pipeLine.Error != null && pipeLine.Error.Count > 0)
|
||||
{
|
||||
foreach (object item in pipeLine.Error.ReadToEnd())
|
||||
{
|
||||
{
|
||||
errorList.Add(item);
|
||||
string errorMessage = string.Format("Invoke error: {0}", item);
|
||||
Log.WriteWarning(errorMessage);
|
||||
Log.WriteWarning(errorMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
</table>
|
||||
|
||||
<div class="FormFooterClean">
|
||||
<asp:Button id="btnAdd" runat="server" Text="Add" CssClass="Button1" meta:resourcekey="btnAdd" ValidationGroup="AddRDSServer" OnClick="btnAdd_Click"></asp:Button>
|
||||
<asp:Button id="btnAdd" runat="server" Text="Add" CssClass="Button1" meta:resourcekey="btnAdd" ValidationGroup="AddRDSServer" OnClick="btnAdd_Click" OnClientClick="ShowProgressDialog('Adding server...');"></asp:Button>
|
||||
<asp:ValidationSummary ID="valSummary" runat="server" ShowMessageBox="True" ShowSummary="False" ValidationGroup="AddRDSServer" />
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
</fieldset>
|
||||
|
||||
<div class="FormFooter">
|
||||
<asp:Button id="btnSave" runat="server" Text="Save" CssClass="Button1" meta:resourcekey="btnSave" OnClick="btnSave_Click" ValidationGroup="SaveRDSCollection"></asp:Button>
|
||||
<asp:Button id="btnSave" runat="server" Text="Save" CssClass="Button1" meta:resourcekey="btnSave" OnClick="btnSave_Click" OnClientClick="ShowProgressDialog('Adding collection...');" ValidationGroup="SaveRDSCollection"></asp:Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue