UpdateDB.sql Quotas fix
This commit is contained in:
parent
34d0c3b6e2
commit
b13ad8cc41
1 changed files with 180 additions and 3 deletions
|
@ -5477,6 +5477,30 @@ GO
|
||||||
|
|
||||||
UPDATE [dbo].[RDSCollections] SET DisplayName = [Name] WHERE DisplayName IS NULL
|
UPDATE [dbo].[RDSCollections] SET DisplayName = [Name] WHERE DisplayName IS NULL
|
||||||
|
|
||||||
|
IF NOT EXISTS(SELECT * FROM SYS.TABLES WHERE name = 'RDSCollectionSettings')
|
||||||
|
CREATE TABLE [dbo].[RDSCollectionSettings](
|
||||||
|
[ID] [int] IDENTITY(1,1) NOT NULL,
|
||||||
|
[RDSCollectionId] [int] NOT NULL,
|
||||||
|
[DisconnectedSessionLimitMin] [int] NULL,
|
||||||
|
[ActiveSessionLimitMin] [int] NULL,
|
||||||
|
[IdleSessionLimitMin] [int] NULL,
|
||||||
|
[BrokenConnectionAction] [nvarchar](20) NULL,
|
||||||
|
[AutomaticReconnectionEnabled] [bit] NULL,
|
||||||
|
[TemporaryFoldersDeletedOnExit] [bit] NULL,
|
||||||
|
[TemporaryFoldersPerSession] [bit] NULL,
|
||||||
|
[ClientDeviceRedirectionOptions] [nvarchar](250) NULL,
|
||||||
|
[ClientPrinterRedirected] [bit] NULL,
|
||||||
|
[ClientPrinterAsDefault] [bit] NULL,
|
||||||
|
[RDEasyPrintDriverEnabled] [bit] NULL,
|
||||||
|
[MaxRedirectedMonitors] [int] NULL,
|
||||||
|
CONSTRAINT [PK_RDSCollectionSettings] PRIMARY KEY CLUSTERED
|
||||||
|
(
|
||||||
|
[ID] ASC
|
||||||
|
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||||
|
) ON [PRIMARY]
|
||||||
|
|
||||||
|
GO
|
||||||
|
|
||||||
|
|
||||||
ALTER TABLE [dbo].[RDSCollectionUsers]
|
ALTER TABLE [dbo].[RDSCollectionUsers]
|
||||||
DROP CONSTRAINT [FK_RDSCollectionUsers_RDSCollectionId]
|
DROP CONSTRAINT [FK_RDSCollectionUsers_RDSCollectionId]
|
||||||
|
@ -5506,6 +5530,15 @@ ALTER TABLE [dbo].[RDSServers] WITH CHECK ADD CONSTRAINT [FK_RDSServers_RDSCol
|
||||||
REFERENCES [dbo].[RDSCollections] ([ID])
|
REFERENCES [dbo].[RDSCollections] ([ID])
|
||||||
GO
|
GO
|
||||||
|
|
||||||
|
IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS WHERE CONSTRAINT_NAME ='FK_RDSCollectionSettings_RDSCollections')
|
||||||
|
ALTER TABLE [dbo].[RDSCollectionSettings] WITH CHECK ADD CONSTRAINT [FK_RDSCollectionSettings_RDSCollections] FOREIGN KEY([RDSCollectionId])
|
||||||
|
REFERENCES [dbo].[RDSCollections] ([ID])
|
||||||
|
ON DELETE CASCADE
|
||||||
|
GO
|
||||||
|
|
||||||
|
ALTER TABLE [dbo].[RDSCollectionSettings] CHECK CONSTRAINT [FK_RDSCollectionSettings_RDSCollections]
|
||||||
|
GO
|
||||||
|
|
||||||
/*Remote Desktop Services Procedures*/
|
/*Remote Desktop Services Procedures*/
|
||||||
|
|
||||||
IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'AddRDSServer')
|
IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'AddRDSServer')
|
||||||
|
@ -6039,6 +6072,150 @@ SELECT
|
||||||
RETURN
|
RETURN
|
||||||
GO
|
GO
|
||||||
|
|
||||||
|
IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetRDSCollectionSettingsByCollectionId')
|
||||||
|
DROP PROCEDURE GetRDSCollectionSettingsByCollectionId
|
||||||
|
GO
|
||||||
|
CREATE PROCEDURE [dbo].[GetRDSCollectionSettingsByCollectionId]
|
||||||
|
(
|
||||||
|
@RDSCollectionID INT
|
||||||
|
)
|
||||||
|
AS
|
||||||
|
|
||||||
|
SELECT TOP 1
|
||||||
|
Id,
|
||||||
|
RDSCollectionId,
|
||||||
|
DisconnectedSessionLimitMin,
|
||||||
|
ActiveSessionLimitMin,
|
||||||
|
IdleSessionLimitMin,
|
||||||
|
BrokenConnectionAction,
|
||||||
|
AutomaticReconnectionEnabled,
|
||||||
|
TemporaryFoldersDeletedOnExit,
|
||||||
|
TemporaryFoldersPerSession,
|
||||||
|
ClientDeviceRedirectionOptions,
|
||||||
|
ClientPrinterRedirected,
|
||||||
|
ClientPrinterAsDefault,
|
||||||
|
RDEasyPrintDriverEnabled,
|
||||||
|
MaxRedirectedMonitors
|
||||||
|
FROM RDSCollectionSettings
|
||||||
|
WHERE RDSCollectionID = @RDSCollectionID
|
||||||
|
GO
|
||||||
|
|
||||||
|
|
||||||
|
IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'AddRDSCollectionSettings')
|
||||||
|
DROP PROCEDURE AddRDSCollectionSettings
|
||||||
|
GO
|
||||||
|
CREATE PROCEDURE [dbo].[AddRDSCollectionSettings]
|
||||||
|
(
|
||||||
|
@RDSCollectionSettingsID INT OUTPUT,
|
||||||
|
@RDSCollectionId INT,
|
||||||
|
@DisconnectedSessionLimitMin INT,
|
||||||
|
@ActiveSessionLimitMin INT,
|
||||||
|
@IdleSessionLimitMin INT,
|
||||||
|
@BrokenConnectionAction NVARCHAR(20),
|
||||||
|
@AutomaticReconnectionEnabled BIT,
|
||||||
|
@TemporaryFoldersDeletedOnExit BIT,
|
||||||
|
@TemporaryFoldersPerSession BIT,
|
||||||
|
@ClientDeviceRedirectionOptions NVARCHAR(250),
|
||||||
|
@ClientPrinterRedirected BIT,
|
||||||
|
@ClientPrinterAsDefault BIT,
|
||||||
|
@RDEasyPrintDriverEnabled BIT,
|
||||||
|
@MaxRedirectedMonitors INT
|
||||||
|
)
|
||||||
|
AS
|
||||||
|
|
||||||
|
INSERT INTO RDSCollectionSettings
|
||||||
|
(
|
||||||
|
RDSCollectionId,
|
||||||
|
DisconnectedSessionLimitMin,
|
||||||
|
ActiveSessionLimitMin,
|
||||||
|
IdleSessionLimitMin,
|
||||||
|
BrokenConnectionAction,
|
||||||
|
AutomaticReconnectionEnabled,
|
||||||
|
TemporaryFoldersDeletedOnExit,
|
||||||
|
TemporaryFoldersPerSession,
|
||||||
|
ClientDeviceRedirectionOptions,
|
||||||
|
ClientPrinterRedirected,
|
||||||
|
ClientPrinterAsDefault,
|
||||||
|
RDEasyPrintDriverEnabled,
|
||||||
|
MaxRedirectedMonitors
|
||||||
|
)
|
||||||
|
VALUES
|
||||||
|
(
|
||||||
|
@RDSCollectionId,
|
||||||
|
@DisconnectedSessionLimitMin,
|
||||||
|
@ActiveSessionLimitMin,
|
||||||
|
@IdleSessionLimitMin,
|
||||||
|
@BrokenConnectionAction,
|
||||||
|
@AutomaticReconnectionEnabled,
|
||||||
|
@TemporaryFoldersDeletedOnExit,
|
||||||
|
@TemporaryFoldersPerSession,
|
||||||
|
@ClientDeviceRedirectionOptions,
|
||||||
|
@ClientPrinterRedirected,
|
||||||
|
@ClientPrinterAsDefault,
|
||||||
|
@RDEasyPrintDriverEnabled,
|
||||||
|
@MaxRedirectedMonitors
|
||||||
|
)
|
||||||
|
|
||||||
|
SET @RDSCollectionSettingsID = SCOPE_IDENTITY()
|
||||||
|
|
||||||
|
RETURN
|
||||||
|
GO
|
||||||
|
|
||||||
|
|
||||||
|
IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'UpdateRDSCollectionSettings')
|
||||||
|
DROP PROCEDURE UpdateRDSCollectionSettings
|
||||||
|
GO
|
||||||
|
CREATE PROCEDURE [dbo].[UpdateRDSCollectionSettings]
|
||||||
|
(
|
||||||
|
@ID INT,
|
||||||
|
@RDSCollectionId INT,
|
||||||
|
@DisconnectedSessionLimitMin INT,
|
||||||
|
@ActiveSessionLimitMin INT,
|
||||||
|
@IdleSessionLimitMin INT,
|
||||||
|
@BrokenConnectionAction NVARCHAR(20),
|
||||||
|
@AutomaticReconnectionEnabled BIT,
|
||||||
|
@TemporaryFoldersDeletedOnExit BIT,
|
||||||
|
@TemporaryFoldersPerSession BIT,
|
||||||
|
@ClientDeviceRedirectionOptions NVARCHAR(250),
|
||||||
|
@ClientPrinterRedirected BIT,
|
||||||
|
@ClientPrinterAsDefault BIT,
|
||||||
|
@RDEasyPrintDriverEnabled BIT,
|
||||||
|
@MaxRedirectedMonitors INT
|
||||||
|
)
|
||||||
|
AS
|
||||||
|
|
||||||
|
UPDATE UpdateRDSCollectionSettings
|
||||||
|
SET
|
||||||
|
RDSCollectionId = @RDSCollectionId,
|
||||||
|
DisconnectedSessionLimitMin = @DisconnectedSessionLimitMin,
|
||||||
|
ActiveSessionLimitMin = @ActiveSessionLimitMin,
|
||||||
|
IdleSessionLimitMin = @IdleSessionLimitMin,
|
||||||
|
BrokenConnectionAction = @BrokenConnectionAction,
|
||||||
|
AutomaticReconnectionEnabled = @AutomaticReconnectionEnabled,
|
||||||
|
TemporaryFoldersDeletedOnExit = @TemporaryFoldersDeletedOnExit,
|
||||||
|
TemporaryFoldersPerSession = @TemporaryFoldersPerSession,
|
||||||
|
ClientDeviceRedirectionOptions = @ClientDeviceRedirectionOptions,
|
||||||
|
ClientPrinterRedirected = @ClientPrinterRedirected,
|
||||||
|
ClientPrinterAsDefault = @ClientPrinterAsDefault,
|
||||||
|
RDEasyPrintDriverEnabled = @RDEasyPrintDriverEnabled,
|
||||||
|
MaxRedirectedMonitors = @MaxRedirectedMonitors
|
||||||
|
WHERE ID = @Id
|
||||||
|
GO
|
||||||
|
|
||||||
|
|
||||||
|
IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'DeleteRDSCollectionSettings')
|
||||||
|
DROP PROCEDURE DeleteRDSCollectionSettings
|
||||||
|
GO
|
||||||
|
CREATE PROCEDURE [dbo].[DeleteRDSCollectionSettings]
|
||||||
|
(
|
||||||
|
@Id int
|
||||||
|
)
|
||||||
|
AS
|
||||||
|
|
||||||
|
DELETE FROM DeleteRDSCollectionSettings
|
||||||
|
WHERE Id = @Id
|
||||||
|
GO
|
||||||
|
|
||||||
-- wsp-10269: Changed php extension path in default properties for IIS70 and IIS80 provider
|
-- wsp-10269: Changed php extension path in default properties for IIS70 and IIS80 provider
|
||||||
update ServiceDefaultProperties
|
update ServiceDefaultProperties
|
||||||
set PropertyValue='%PROGRAMFILES(x86)%\PHP\php-cgi.exe'
|
set PropertyValue='%PROGRAMFILES(x86)%\PHP\php-cgi.exe'
|
||||||
|
@ -7751,12 +7928,12 @@ GO
|
||||||
--add Deleted Users Quota
|
--add Deleted Users Quota
|
||||||
IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'HostedSolution.DeletedUsers')
|
IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'HostedSolution.DeletedUsers')
|
||||||
BEGIN
|
BEGIN
|
||||||
INSERT [dbo].[Quotas] ([QuotaID], [GroupID],[QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (477, 13, 6, N'HostedSolution.DeletedUsers', N'Deleted Users', 2, 0, NULL, NULL)
|
INSERT [dbo].[Quotas] ([QuotaID], [GroupID],[QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (495, 13, 6, N'HostedSolution.DeletedUsers', N'Deleted Users', 2, 0, NULL, NULL)
|
||||||
END
|
END
|
||||||
|
|
||||||
IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'HostedSolution.DeletedUsersBackupStorageSpace')
|
IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'HostedSolution.DeletedUsersBackupStorageSpace')
|
||||||
BEGIN
|
BEGIN
|
||||||
INSERT [dbo].[Quotas] ([QuotaID], [GroupID],[QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (478, 13, 6, N'HostedSolution.DeletedUsersBackupStorageSpace', N'Deleted Users Backup Storage Space, Mb', 2, 0, NULL, NULL)
|
INSERT [dbo].[Quotas] ([QuotaID], [GroupID],[QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (496, 13, 6, N'HostedSolution.DeletedUsersBackupStorageSpace', N'Deleted Users Backup Storage Space, Mb', 2, 0, NULL, NULL)
|
||||||
END
|
END
|
||||||
GO
|
GO
|
||||||
|
|
||||||
|
@ -8003,7 +8180,7 @@ AS
|
||||||
INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID
|
INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID
|
||||||
INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID
|
INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID
|
||||||
WHERE pt.ParentPackageID = @PackageID AND ea.AccountType IN (8,9))
|
WHERE pt.ParentPackageID = @PackageID AND ea.AccountType IN (8,9))
|
||||||
ELSE IF @QuotaID = 477 -- HostedSolution.DeletedUsers
|
ELSE IF @QuotaID = 495 -- HostedSolution.DeletedUsers
|
||||||
SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts AS ea
|
SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts AS ea
|
||||||
INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID
|
INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID
|
||||||
INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID
|
INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue