mirror of
https://github.com/Microsoft/sql-server-samples.git
synced 2025-12-08 14:58:54 +00:00
Remove extra spacing
This commit is contained in:
@@ -24,7 +24,7 @@ EXEC sys.sp_executesql N'CREATE SCHEMA [policy] AUTHORIZATION [dbo]'
|
||||
|
||||
--Create the table to store the results from the PowerShell evaluation.
|
||||
IF NOT EXISTS(SELECT * FROM sys.objects WHERE type = N'U' AND name = N'PolicyHistory')
|
||||
BEGIN
|
||||
BEGIN
|
||||
CREATE TABLE [policy].[PolicyHistory](
|
||||
[PolicyHistoryID] [int] IDENTITY NOT NULL ,
|
||||
[EvaluatedServer] [nvarchar](50) NULL,
|
||||
@@ -38,7 +38,7 @@ BEGIN
|
||||
END
|
||||
GO
|
||||
IF EXISTS(SELECT * FROM sys.columns WHERE object_id = object_id('policy.policyhistory') AND name = 'PolicyResult')
|
||||
BEGIN
|
||||
BEGIN
|
||||
ALTER TABLE policy.PolicyHistory
|
||||
DROP COLUMN PolicyResult
|
||||
END
|
||||
@@ -51,7 +51,7 @@ GO
|
||||
|
||||
CREATE XML INDEX IX_EvaluationResults_PROPERTY ON policy.PolicyHistory (EvaluationResults)
|
||||
USING XML INDEX IX_EvaluationResults
|
||||
FOR PROPERTY
|
||||
FOR PROPERTY
|
||||
GO
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[policy].[PolicyHistory]') AND name = N'IX_EvaluatedPolicy')
|
||||
@@ -75,7 +75,7 @@ GO
|
||||
|
||||
--Create the table to store the error information from the failed PowerShell executions.
|
||||
IF NOT EXISTS (SELECT * FROM sys.objects WHERE type = N'U' AND name = N'EvaluationErrorHistory')
|
||||
BEGIN
|
||||
BEGIN
|
||||
CREATE TABLE [policy].[EvaluationErrorHistory](
|
||||
[ErrorHistoryID] [int] IDENTITY(1,1) NOT NULL,
|
||||
[EvaluatedServer] [nvarchar](50) NULL,
|
||||
@@ -150,8 +150,8 @@ GO
|
||||
ALTER TABLE policy.PolicyHistoryDetail ADD CONSTRAINT
|
||||
FK_PolicyHistoryDetail_PolicyHistory FOREIGN KEY
|
||||
(PolicyHistoryID) REFERENCES policy.PolicyHistory
|
||||
(PolicyHistoryID)
|
||||
ON UPDATE CASCADE
|
||||
(PolicyHistoryID)
|
||||
ON UPDATE CASCADE
|
||||
ON DELETE CASCADE
|
||||
GO
|
||||
|
||||
@@ -164,7 +164,7 @@ GO
|
||||
IF EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[policy].[PolicyHistoryDetail]') AND name = N'IX_EvaluatedPolicy')
|
||||
DROP INDEX IX_EvaluatedPolicy ON policy.PolicyHistoryDetail
|
||||
GO
|
||||
CREATE INDEX IX_EvaluatedPolicy ON [policy].[PolicyHistoryDetail] ([EvaluatedPolicy])
|
||||
CREATE INDEX IX_EvaluatedPolicy ON [policy].[PolicyHistoryDetail] ([EvaluatedPolicy])
|
||||
INCLUDE ([PolicyHistoryID], [EvaluatedServer], [EvaluationDateTime], [MonthYear], [policy_id], [CategoryName], [EvaluatedObject], [PolicyResult])
|
||||
GO
|
||||
IF EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[policy].[PolicyHistoryDetail]') AND name = N'IX_PolicyHistoryView')
|
||||
@@ -230,7 +230,7 @@ GO
|
||||
CREATE STATISTICS [Stat_EvaluationDateTime_EvaluatedPolicy] ON [policy].[PolicyHistoryDetail]([EvaluationDateTime], [EvaluatedPolicy])
|
||||
GO
|
||||
|
||||
IF EXISTS(SELECT * FROM sys.stats WHERE object_id = OBJECT_ID(N'[policy].[PolicyHistoryDetail]') AND name = 'Stat_CategoryName_EvaluatedServer')
|
||||
IF EXISTS(SELECT * FROM sys.stats WHERE object_id = OBJECT_ID(N'[policy].[PolicyHistoryDetail]') AND name = 'Stat_CategoryName_EvaluatedServer')
|
||||
DROP STATISTICS policy.[PolicyHistoryDetail].[Stat_CategoryName_EvaluatedServer]
|
||||
GO
|
||||
CREATE STATISTICS [Stat_CategoryName_EvaluatedServer] ON [policy].[PolicyHistoryDetail] ([CategoryName], [EvaluatedServer])
|
||||
@@ -370,8 +370,8 @@ GO
|
||||
|
||||
--Create the function to support server selection.
|
||||
--The following function will support nested CMS folders for the EPM Framework.
|
||||
--The function must be created in a database ON the CMS server.
|
||||
--This database will also store the policy history.
|
||||
--The function must be created in a database ON the CMS server.
|
||||
--This database will also store the policy history.
|
||||
|
||||
USE $(ManagementDatabase)
|
||||
GO
|
||||
@@ -381,14 +381,14 @@ GO
|
||||
CREATE FUNCTION [policy].[pfn_ServerGroupInstances] (@server_group_name NVARCHAR(128))
|
||||
RETURNS TABLE
|
||||
AS
|
||||
RETURN(WITH ServerGroups(parent_id, server_group_id, name) AS
|
||||
RETURN(WITH ServerGroups(parent_id, server_group_id, name) AS
|
||||
(
|
||||
SELECT parent_id, server_group_id, name
|
||||
SELECT parent_id, server_group_id, name
|
||||
FROM msdb.dbo.sysmanagement_shared_server_groups tg
|
||||
WHERE is_system_object = 0
|
||||
AND (tg.name = @server_group_name OR @server_group_name = '')
|
||||
UNION ALL
|
||||
SELECT cg.parent_id, cg.server_group_id, cg.name
|
||||
SELECT cg.parent_id, cg.server_group_id, cg.name
|
||||
FROM msdb.dbo.sysmanagement_shared_server_groups cg
|
||||
INNER JOIN ServerGroups pg ON cg.parent_id = pg.server_group_id
|
||||
)
|
||||
@@ -411,14 +411,14 @@ IF @server_group_name = ''
|
||||
ON s.server_group_id = ssg.server_group_id
|
||||
END
|
||||
ELSE
|
||||
WITH ServerGroups(parent_id, server_group_id, name) AS
|
||||
WITH ServerGroups(parent_id, server_group_id, name) AS
|
||||
(
|
||||
SELECT parent_id, server_group_id, name
|
||||
SELECT parent_id, server_group_id, name
|
||||
FROM msdb.dbo.sysmanagement_shared_server_groups tg
|
||||
WHERE is_system_object = 0
|
||||
AND (tg.name = @server_group_name OR @server_group_name = '')
|
||||
UNION ALL
|
||||
SELECT cg.parent_id, cg.server_group_id, cg.name
|
||||
SELECT cg.parent_id, cg.server_group_id, cg.name
|
||||
FROM msdb.dbo.sysmanagement_shared_server_groups cg
|
||||
INNER JOIN ServerGroups pg ON cg.parent_id = pg.server_group_id
|
||||
)
|
||||
@@ -433,17 +433,17 @@ GO
|
||||
|
||||
--Create the views which are used in the policy reports
|
||||
|
||||
--Drop the view if it exists.
|
||||
--Drop the view if it exists.
|
||||
IF EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[policy].[v_ServerGroups]'))
|
||||
DROP VIEW [policy].[v_ServerGroups]
|
||||
GO
|
||||
CREATE VIEW policy.v_ServerGroups AS
|
||||
WITH ServerGroups(parent_id, server_group_id, GroupName, GroupLevel, Sort, GroupValue)
|
||||
AS
|
||||
CREATE VIEW policy.v_ServerGroups AS
|
||||
WITH ServerGroups(parent_id, server_group_id, GroupName, GroupLevel, Sort, GroupValue)
|
||||
AS
|
||||
(SELECT parent_id
|
||||
, server_group_id
|
||||
, CAST('ALL' AS varchar(500))
|
||||
, 1 AS GroupLevel
|
||||
, 1 AS GroupLevel
|
||||
, CAST('ALL' AS varchar(500)) AS Sort
|
||||
, CAST('' AS varchar(255)) AS GroupValue
|
||||
FROM msdb.dbo.sysmanagement_shared_server_groups tg
|
||||
@@ -459,18 +459,18 @@ FROM msdb.dbo.sysmanagement_shared_server_groups cg
|
||||
INNER JOIN ServerGroups pg ON cg.parent_id = pg.server_group_id)
|
||||
|
||||
SELECT parent_id, server_group_id, GroupName, GroupLevel, Sort, GroupValue
|
||||
FROM ServerGroups
|
||||
FROM ServerGroups
|
||||
GO
|
||||
|
||||
|
||||
--Drop the view if it exists.
|
||||
--Drop the view if it exists.
|
||||
IF EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[policy].[v_PolicyHistory]'))
|
||||
DROP VIEW [policy].[v_PolicyHistory]
|
||||
GO
|
||||
CREATE VIEW [policy].[v_PolicyHistory]
|
||||
AS
|
||||
--The policy.v_PolicyHistory view will return all results
|
||||
--and identify the policy evaluation result AS PASS, FAIL, or
|
||||
--and identify the policy evaluation result AS PASS, FAIL, or
|
||||
--ERROR. The ERROR result indicates that the policy was not able
|
||||
--to evaluate against an object.
|
||||
SELECT PH.PolicyHistoryID
|
||||
@@ -487,18 +487,18 @@ SELECT PH.PolicyHistoryID
|
||||
FROM policy.PolicyHistoryDetail PH
|
||||
INNER JOIN msdb.dbo.syspolicy_policies AS p ON p.name = PH.EvaluatedPolicy
|
||||
--INNER JOIN msdb.dbo.syspolicy_policy_categories AS c ON p.policy_category_id = c.policy_category_id
|
||||
AND PH.EvaluatedPolicy NOT IN (SELECT spp.name
|
||||
FROM msdb.dbo.syspolicy_policies spp
|
||||
AND PH.EvaluatedPolicy NOT IN (SELECT spp.name
|
||||
FROM msdb.dbo.syspolicy_policies spp
|
||||
INNER JOIN msdb.dbo.syspolicy_policy_categories spc ON spp.policy_category_id = spc.policy_category_id
|
||||
WHERE spc.name = 'Disabled')
|
||||
GO
|
||||
|
||||
|
||||
--Drop the view if it exists.
|
||||
--Drop the view if it exists.
|
||||
IF EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[policy].[v_PolicyHistory_Rank]'))
|
||||
DROP VIEW policy.v_PolicyHistory_Rank
|
||||
GO
|
||||
CREATE VIEW policy.v_PolicyHistory_Rank
|
||||
CREATE VIEW policy.v_PolicyHistory_Rank
|
||||
AS
|
||||
SELECT PolicyHistoryID
|
||||
, EvaluatedServer
|
||||
@@ -517,13 +517,13 @@ SELECT PolicyHistoryID
|
||||
FROM policy.v_PolicyHistory VPH
|
||||
GO
|
||||
|
||||
--Drop the view if it exists.
|
||||
--Drop the view if it exists.
|
||||
IF EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[policy].[v_PolicyHistory_LastEvaluation]'))
|
||||
DROP VIEW policy.v_PolicyHistory_LastEvaluation
|
||||
GO
|
||||
CREATE VIEW policy.v_PolicyHistory_LastEvaluation
|
||||
AS
|
||||
--The policy.v_PolicyHistory_LastEvaluation view will the last result for any given policy evaluated against an object.
|
||||
--The policy.v_PolicyHistory_LastEvaluation view will the last result for any given policy evaluated against an object.
|
||||
--This view requires the v_PolicyHistory view exist.
|
||||
SELECT PolicyHistoryID
|
||||
, EvaluatedServer
|
||||
@@ -547,9 +547,9 @@ AND NOT EXISTS(
|
||||
AND PH.EvaluationDateTime > VPH.EvaluationDateTime)
|
||||
GO
|
||||
|
||||
--Create a view to return all errors.
|
||||
--Create a view to return all errors.
|
||||
--Errors will be returned from the table EvaluationErrorHistory and the errors in the PolicyHistory table.
|
||||
--Drop the view if it exists.
|
||||
--Drop the view if it exists.
|
||||
IF EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[policy].[v_EvaluationErrorHistory]'))
|
||||
DROP VIEW policy.v_EvaluationErrorHistory
|
||||
GO
|
||||
@@ -559,7 +559,7 @@ SELECT EEH.ErrorHistoryID
|
||||
, EEH.EvaluatedServer
|
||||
, EEH.EvaluationDateTime
|
||||
, EEH.EvaluatedPolicy
|
||||
, CASE WHEN CHARINDEX('\', EEH.EvaluatedServer) > 0
|
||||
, CASE WHEN CHARINDEX('\', EEH.EvaluatedServer) > 0
|
||||
THEN RIGHT(EEH.EvaluatedServer, CHARINDEX('\', REVERSE(EEH.EvaluatedServer)) - 1)
|
||||
ELSE EEH.EvaluatedServer
|
||||
END
|
||||
@@ -577,10 +577,10 @@ SELECT PolicyHistoryID
|
||||
, EvaluatedServer
|
||||
, EvaluationDateTime
|
||||
, EvaluatedPolicy
|
||||
, CASE WHEN CHARINDEX('\', REVERSE(EvaluatedObject)) >0
|
||||
THEN RIGHT(EvaluatedObject,CHARINDEX('\', REVERSE(EvaluatedObject)) - 1)
|
||||
ELSE EvaluatedObject
|
||||
END
|
||||
, CASE WHEN CHARINDEX('\', REVERSE(EvaluatedObject)) >0
|
||||
THEN RIGHT(EvaluatedObject,CHARINDEX('\', REVERSE(EvaluatedObject)) - 1)
|
||||
ELSE EvaluatedObject
|
||||
END
|
||||
AS EvaluatedObject
|
||||
, ExceptionMessage
|
||||
, policy_id
|
||||
@@ -593,7 +593,7 @@ GO
|
||||
|
||||
--Create a view to return the last error for each policy against
|
||||
--an instance.
|
||||
--Drop the view if it exists.
|
||||
--Drop the view if it exists.
|
||||
IF EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[policy].[v_EvaluationErrorHistory_LastEvaluation]'))
|
||||
DROP VIEW policy.v_EvaluationErrorHistory_LastEvaluation
|
||||
GO
|
||||
@@ -614,7 +614,7 @@ SELECT ErrorHistoryID
|
||||
ORDER BY EvaluationDateTime DESC)AS EvaluationOrderDesc
|
||||
FROM policy.v_EvaluationErrorHistory EEH
|
||||
WHERE NOT EXISTS (
|
||||
SELECT *
|
||||
SELECT *
|
||||
FROM policy.PolicyHistoryDetail PH
|
||||
WHERE PH.EvaluatedPolicy = EEH.EvaluatedPolicy
|
||||
AND PH.EvaluatedServer = EEH.EvaluatedServer
|
||||
@@ -692,7 +692,7 @@ SELECT PolicyHistoryID
|
||||
, policy_id
|
||||
, CategoryName
|
||||
, MonthYear
|
||||
, PolicyHistorySource
|
||||
, PolicyHistorySource
|
||||
FROM cteEval
|
||||
WHERE cteEval.[TopRank] = 1'; -- Remove duplicates
|
||||
|
||||
@@ -726,10 +726,10 @@ SELECT PH.PolicyHistoryID
|
||||
, PH.EvaluatedPolicy
|
||||
, ''No Targets Found'' AS EvaluatedObject
|
||||
, (CASE WHEN Res.Expr.value(''(../DMF:Result)[1]'', ''nvarchar(150)'')= ''FALSE'' AND Expr.value(''(../DMF:Exception)[1]'', ''nvarchar(max)'') = ''''
|
||||
THEN ''FAIL''
|
||||
THEN ''FAIL''
|
||||
WHEN Res.Expr.value(''(../DMF:Result)[1]'', ''nvarchar(150)'')= ''FALSE'' AND Expr.value(''(../DMF:Exception)[1]'', ''nvarchar(max)'')<> ''''
|
||||
THEN ''ERROR''
|
||||
ELSE ''PASS''
|
||||
ELSE ''PASS''
|
||||
END) AS PolicyResult
|
||||
, Expr.value(''(../DMF:Exception)[1]'', ''nvarchar(max)'') AS ExceptionMessage
|
||||
, NULL AS ResultDetail
|
||||
|
||||
+26
-26
@@ -21,7 +21,7 @@ IF EXISTS(SELECT * FROM sys.stats WHERE object_id = OBJECT_ID(N'[policy].[Policy
|
||||
DROP STATISTICS policy.[PolicyHistoryDetail].[Stat_EvaluatedPolicy]
|
||||
GO
|
||||
|
||||
IF EXISTS(SELECT * FROM sys.stats WHERE object_id = OBJECT_ID(N'[policy].[PolicyHistoryDetail]') AND name = 'Stat_CategoryName')
|
||||
IF EXISTS(SELECT * FROM sys.stats WHERE object_id = OBJECT_ID(N'[policy].[PolicyHistoryDetail]') AND name = 'Stat_CategoryName')
|
||||
DROP STATISTICS policy.[PolicyHistoryDetail].[Stat_CategoryName]
|
||||
GO
|
||||
|
||||
@@ -81,8 +81,8 @@ GO
|
||||
ALTER TABLE policy.PolicyHistoryDetail ADD CONSTRAINT
|
||||
FK_PolicyHistoryDetail_PolicyHistory FOREIGN KEY
|
||||
(PolicyHistoryID) REFERENCES policy.PolicyHistory
|
||||
(PolicyHistoryID)
|
||||
ON UPDATE CASCADE
|
||||
(PolicyHistoryID)
|
||||
ON UPDATE CASCADE
|
||||
ON DELETE CASCADE
|
||||
GO
|
||||
|
||||
@@ -149,7 +149,7 @@ GO
|
||||
CREATE STATISTICS [Stat_EvaluationDateTime_EvaluatedPolicy] ON [policy].[PolicyHistoryDetail]([EvaluationDateTime], [EvaluatedPolicy])
|
||||
GO
|
||||
|
||||
IF EXISTS(SELECT * FROM sys.stats WHERE object_id = OBJECT_ID(N'[policy].[PolicyHistoryDetail]') AND name = 'Stat_CategoryName_EvaluatedServer')
|
||||
IF EXISTS(SELECT * FROM sys.stats WHERE object_id = OBJECT_ID(N'[policy].[PolicyHistoryDetail]') AND name = 'Stat_CategoryName_EvaluatedServer')
|
||||
DROP STATISTICS policy.[PolicyHistoryDetail].[Stat_CategoryName_EvaluatedServer]
|
||||
GO
|
||||
CREATE STATISTICS [Stat_CategoryName_EvaluatedServer] ON [policy].[PolicyHistoryDetail] ([CategoryName], [EvaluatedServer])
|
||||
@@ -289,8 +289,8 @@ GO
|
||||
|
||||
--Update the function to support server selection.
|
||||
--The following function will support nested CMS folders for the EPM Framework.
|
||||
--The function must be created in a database ON the CMS server.
|
||||
--This database will also store the policy history.
|
||||
--The function must be created in a database ON the CMS server.
|
||||
--This database will also store the policy history.
|
||||
|
||||
USE $(ManagementDatabase)
|
||||
GO
|
||||
@@ -300,14 +300,14 @@ GO
|
||||
CREATE FUNCTION [policy].[pfn_ServerGroupInstances] (@server_group_name NVARCHAR(128))
|
||||
RETURNS TABLE
|
||||
AS
|
||||
RETURN(WITH ServerGroups(parent_id, server_group_id, name) AS
|
||||
RETURN(WITH ServerGroups(parent_id, server_group_id, name) AS
|
||||
(
|
||||
SELECT parent_id, server_group_id, name
|
||||
SELECT parent_id, server_group_id, name
|
||||
FROM msdb.dbo.sysmanagement_shared_server_groups tg
|
||||
WHERE is_system_object = 0
|
||||
AND (tg.name = @server_group_name OR @server_group_name = '')
|
||||
UNION ALL
|
||||
SELECT cg.parent_id, cg.server_group_id, cg.name
|
||||
SELECT cg.parent_id, cg.server_group_id, cg.name
|
||||
FROM msdb.dbo.sysmanagement_shared_server_groups cg
|
||||
INNER JOIN ServerGroups pg ON cg.parent_id = pg.server_group_id
|
||||
)
|
||||
@@ -322,13 +322,13 @@ GO
|
||||
IF EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[policy].[v_ServerGroups]'))
|
||||
DROP VIEW [policy].[v_ServerGroups]
|
||||
GO
|
||||
CREATE VIEW policy.v_ServerGroups AS
|
||||
WITH ServerGroups(parent_id, server_group_id, GroupName, GroupLevel, Sort, GroupValue)
|
||||
AS
|
||||
CREATE VIEW policy.v_ServerGroups AS
|
||||
WITH ServerGroups(parent_id, server_group_id, GroupName, GroupLevel, Sort, GroupValue)
|
||||
AS
|
||||
(SELECT parent_id
|
||||
, server_group_id
|
||||
, CAST('ALL' AS varchar(500))
|
||||
, 1 AS GroupLevel
|
||||
, 1 AS GroupLevel
|
||||
, CAST('ALL' AS varchar(500)) AS Sort
|
||||
, CAST('' AS varchar(255)) AS GroupValue
|
||||
FROM msdb.dbo.sysmanagement_shared_server_groups tg
|
||||
@@ -344,7 +344,7 @@ FROM msdb.dbo.sysmanagement_shared_server_groups cg
|
||||
INNER JOIN ServerGroups pg ON cg.parent_id = pg.server_group_id)
|
||||
|
||||
SELECT parent_id, server_group_id, GroupName, GroupLevel, Sort, GroupValue
|
||||
FROM ServerGroups
|
||||
FROM ServerGroups
|
||||
GO
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[policy].[v_PolicyHistory]'))
|
||||
@@ -353,7 +353,7 @@ GO
|
||||
CREATE VIEW [policy].[v_PolicyHistory]
|
||||
AS
|
||||
--The policy.v_PolicyHistory view will return all results
|
||||
--and identify the policy evaluation result AS PASS, FAIL, or
|
||||
--and identify the policy evaluation result AS PASS, FAIL, or
|
||||
--ERROR. The ERROR result indicates that the policy was not able
|
||||
--to evaluate against an object.
|
||||
SELECT PH.PolicyHistoryID
|
||||
@@ -370,8 +370,8 @@ SELECT PH.PolicyHistoryID
|
||||
FROM policy.PolicyHistoryDetail PH
|
||||
INNER JOIN msdb.dbo.syspolicy_policies AS p ON p.name = PH.EvaluatedPolicy
|
||||
--INNER JOIN msdb.dbo.syspolicy_policy_categories AS c ON p.policy_category_id = c.policy_category_id
|
||||
AND PH.EvaluatedPolicy NOT IN (SELECT spp.name
|
||||
FROM msdb.dbo.syspolicy_policies spp
|
||||
AND PH.EvaluatedPolicy NOT IN (SELECT spp.name
|
||||
FROM msdb.dbo.syspolicy_policies spp
|
||||
INNER JOIN msdb.dbo.syspolicy_policy_categories spc ON spp.policy_category_id = spc.policy_category_id
|
||||
WHERE spc.name = 'Disabled')
|
||||
GO
|
||||
@@ -379,7 +379,7 @@ GO
|
||||
IF EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[policy].[v_PolicyHistory_Rank]'))
|
||||
DROP VIEW policy.v_PolicyHistory_Rank
|
||||
GO
|
||||
CREATE VIEW policy.v_PolicyHistory_Rank
|
||||
CREATE VIEW policy.v_PolicyHistory_Rank
|
||||
AS
|
||||
SELECT PolicyHistoryID
|
||||
, EvaluatedServer
|
||||
@@ -403,7 +403,7 @@ DROP VIEW policy.v_PolicyHistory_LastEvaluation
|
||||
GO
|
||||
CREATE VIEW policy.v_PolicyHistory_LastEvaluation
|
||||
AS
|
||||
--The policy.v_PolicyHistory_LastEvaluation view will the last result for any given policy evaluated against an object.
|
||||
--The policy.v_PolicyHistory_LastEvaluation view will the last result for any given policy evaluated against an object.
|
||||
--This view requires the v_PolicyHistory view exist.
|
||||
SELECT PolicyHistoryID
|
||||
, EvaluatedServer
|
||||
@@ -427,9 +427,9 @@ AND NOT EXISTS(
|
||||
AND PH.EvaluationDateTime > VPH.EvaluationDateTime)
|
||||
GO
|
||||
|
||||
--Create a view to return all errors.
|
||||
--Create a view to return all errors.
|
||||
--Errors will be returned from the table EvaluationErrorHistory and the errors in the PolicyHistory table.
|
||||
--Drop the view if it exists.
|
||||
--Drop the view if it exists.
|
||||
IF EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[policy].[v_EvaluationErrorHistory]'))
|
||||
DROP VIEW policy.v_EvaluationErrorHistory
|
||||
GO
|
||||
@@ -439,7 +439,7 @@ SELECT EEH.ErrorHistoryID
|
||||
, EEH.EvaluatedServer
|
||||
, EEH.EvaluationDateTime
|
||||
, EEH.EvaluatedPolicy
|
||||
, CASE WHEN CHARINDEX('\', EEH.EvaluatedServer) > 0
|
||||
, CASE WHEN CHARINDEX('\', EEH.EvaluatedServer) > 0
|
||||
THEN RIGHT(EEH.EvaluatedServer, CHARINDEX('\', REVERSE(EEH.EvaluatedServer)) - 1)
|
||||
ELSE EEH.EvaluatedServer
|
||||
END
|
||||
@@ -487,7 +487,7 @@ SELECT ErrorHistoryID
|
||||
ORDER BY EvaluationDateTime DESC)AS EvaluationOrderDesc
|
||||
FROM policy.v_EvaluationErrorHistory EEH
|
||||
WHERE NOT EXISTS (
|
||||
SELECT *
|
||||
SELECT *
|
||||
FROM policy.PolicyHistoryDetail PH
|
||||
WHERE PH.EvaluatedPolicy = EEH.EvaluatedPolicy
|
||||
AND PH.EvaluatedServer = EEH.EvaluatedServer
|
||||
@@ -564,7 +564,7 @@ SELECT PolicyHistoryID
|
||||
, policy_id
|
||||
, CategoryName
|
||||
, MonthYear
|
||||
, PolicyHistorySource
|
||||
, PolicyHistorySource
|
||||
FROM cteEval
|
||||
WHERE cteEval.[TopRank] = 1'; -- Remove duplicates
|
||||
|
||||
@@ -598,10 +598,10 @@ SELECT PH.PolicyHistoryID
|
||||
, PH.EvaluatedPolicy
|
||||
, ''No Targets Found'' AS EvaluatedObject
|
||||
, (CASE WHEN Res.Expr.value(''(../DMF:Result)[1]'', ''nvarchar(150)'')= ''FALSE'' AND Expr.value(''(../DMF:Exception)[1]'', ''nvarchar(max)'') = ''''
|
||||
THEN ''FAIL''
|
||||
THEN ''FAIL''
|
||||
WHEN Res.Expr.value(''(../DMF:Result)[1]'', ''nvarchar(150)'')= ''FALSE'' AND Expr.value(''(../DMF:Exception)[1]'', ''nvarchar(max)'')<> ''''
|
||||
THEN ''ERROR''
|
||||
ELSE ''PASS''
|
||||
ELSE ''PASS''
|
||||
END) AS PolicyResult
|
||||
, Expr.value(''(../DMF:Exception)[1]'', ''nvarchar(max)'') AS ExceptionMessage
|
||||
, NULL AS ResultDetail
|
||||
|
||||
+14
-14
@@ -1,7 +1,7 @@
|
||||
# Evaluate specific Policies against a Server List
|
||||
# Uses the Invoke-PolicyEvaluation Cmdlet
|
||||
|
||||
#SAMPLE: #.\EPM_EnterpriseEvaluation_5.ps1 -ConfigurationGroup "DEV" -PolicyCategoryFilter "Name Pattern" –EvalMode “Check”
|
||||
#SAMPLE: #.\EPM_EnterpriseEvaluation_5.ps1 -ConfigurationGroup "DEV" -PolicyCategoryFilter "Name Pattern" �EvalMode �Check�
|
||||
|
||||
<#
|
||||
Run Powershell ISE as Admin
|
||||
@@ -25,12 +25,12 @@ param([string]$ConfigurationGroup=$(Throw `
|
||||
Remove-Module SQLPS -Force -ErrorAction SilentlyContinue
|
||||
Import-Module SqlServer -DisableNameChecking -MinimumVersion "21.0.171.78"
|
||||
|
||||
# Parameter -ConfigurationGroup specifies the
|
||||
# Parameter -ConfigurationGroup specifies the
|
||||
# Central Management Server group to evaluate
|
||||
# Parameter -PolicyCategoryFilter specifies the
|
||||
# Parameter -PolicyCategoryFilter specifies the
|
||||
# category of policies to evaluate
|
||||
# Parameter -EvalMode accepts "Check" to report policy
|
||||
# results, "Configure" to reconfigure any violations
|
||||
# results, "Configure" to reconfigure any violations
|
||||
|
||||
# Declare variables to define the central warehouse
|
||||
# in which to write the output, store the policies
|
||||
@@ -41,7 +41,7 @@ $ResultDir = "E:\Results\"
|
||||
# End of variables
|
||||
|
||||
#Function to insert policy evaluation results into SQL Server - table policy.PolicyHistory
|
||||
function PolicyHistoryInsert($sqlServerVariable, $sqlDatabaseVariable, $EvaluatedServer, $EvaluatedPolicy, $EvaluationResults)
|
||||
function PolicyHistoryInsert($sqlServerVariable, $sqlDatabaseVariable, $EvaluatedServer, $EvaluatedPolicy, $EvaluationResults)
|
||||
{
|
||||
&{
|
||||
$sqlQueryText = "INSERT INTO policy.PolicyHistory (EvaluatedServer, EvaluatedPolicy, EvaluationResults) VALUES(N'$EvaluatedServer', N'$EvaluatedPolicy', N'$EvaluationResults')"
|
||||
@@ -49,12 +49,12 @@ function PolicyHistoryInsert($sqlServerVariable, $sqlDatabaseVariable, $Evaluate
|
||||
}
|
||||
trap
|
||||
{
|
||||
$ExceptionText = $_.Exception.Message -replace "'", ""
|
||||
$ExceptionText = $_.Exception.Message -replace "'", ""
|
||||
}
|
||||
}
|
||||
|
||||
#Function to insert policy evaluation errors into SQL Server - table policy.EvaluationErrorHistory
|
||||
function PolicyErrorInsert($sqlServerVariable, $sqlDatabaseVariable, $EvaluatedServer, $EvaluatedPolicy, $EvaluationResultsEscape)
|
||||
function PolicyErrorInsert($sqlServerVariable, $sqlDatabaseVariable, $EvaluatedServer, $EvaluatedPolicy, $EvaluationResultsEscape)
|
||||
{
|
||||
&{
|
||||
$sqlQueryText = "INSERT INTO policy.EvaluationErrorHistory (EvaluatedServer, EvaluatedPolicy, EvaluationResults) VALUES(N'$EvaluatedServer', N'$EvaluatedPolicy', N'$EvaluationResultsEscape')"
|
||||
@@ -67,7 +67,7 @@ function PolicyErrorInsert($sqlServerVariable, $sqlDatabaseVariable, $EvaluatedS
|
||||
}
|
||||
|
||||
#Function to delete files from this policy only
|
||||
function PolicyFileDelete($File)
|
||||
function PolicyFileDelete($File)
|
||||
{
|
||||
# Delete evaluation files in the directory.
|
||||
Remove-Item -Path $File
|
||||
@@ -95,7 +95,7 @@ $dr = $cmd.ExecuteReader();
|
||||
# the policies. For each server and policy,
|
||||
# call cmdlet to evaluate policy on server and delete xml file afterwards
|
||||
|
||||
while ($dr.Read()) {
|
||||
while ($dr.Read()) {
|
||||
$ServerName = $dr.GetValue(0);
|
||||
foreach ($Policy in $PolicyStore.Policies)
|
||||
{
|
||||
@@ -105,22 +105,22 @@ while ($dr.Read()) {
|
||||
$OutputFile = $ResultDir + ("{0}_{1}.xml" -f (Encode-SqlName $ServerName ), ($Policy.Name));
|
||||
Invoke-PolicyEvaluation -Policy $Policy -TargetServerName $ServerName -AdHocPolicyEvaluationMode $EvalMode -OutputXML > $OutputFile;
|
||||
$PolicyResult = Get-Content $OutputFile -encoding UTF8;
|
||||
$PolicyResult = $PolicyResult -replace "'", ""
|
||||
$PolicyResult = $PolicyResult -replace "'", ""
|
||||
PolicyHistoryInsert $CentralManagementServer $HistoryDatabase $ServerName $Policy.Name $PolicyResult;
|
||||
$File = $ResultDir + ("*_{0}.xml" -f ($Policy.Name));
|
||||
PolicyFileDelete $File;
|
||||
}
|
||||
trap [Exception]
|
||||
{
|
||||
{
|
||||
$File = $ResultDir + ("*_{0}.xml" -f ($Policy.Name));
|
||||
PolicyFileDelete $File;
|
||||
$ExceptionText = $_.Exception.Message -replace "'", ""
|
||||
$ExceptionText = $_.Exception.Message -replace "'", ""
|
||||
$ExceptionMessage = $_.Exception.GetType().FullName + ", " + $ExceptionText
|
||||
PolicyErrorInsert $CentralManagementServer $HistoryDatabase $ServerName $Policy.Name $ExceptionMessage;
|
||||
continue;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$dr.Close()
|
||||
|
||||
@@ -137,9 +137,9 @@ AND EvaluatedPolicy IN (@EvaluatedPolicy)
|
||||
AND (EvaluatedServer IN (SELECT server_name
|
||||
FROM policy.pfn_ServerGroupInstances(@ServerGroupName))
|
||||
OR @ServerGroupName = '')
|
||||
AND (EvaluationDateTime >= DATEADD(d,-day(DateAdd(Month, -6, @DateMonth))+1, CAST(DateAdd(Month, -6, @DateMonth) AS DATE))
|
||||
AND (EvaluationDateTime >= DATEADD(d,-day(DateAdd(Month, -6, @DateMonth))+1, CAST(DateAdd(Month, -6, @DateMonth) AS DATE))
|
||||
AND EvaluationDateTime < DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,@DateMonth)+1,0))
|
||||
OR (EvaluationDateTime >= DATEADD(d,-day(DateAdd(Month, -6, GETDATE()))+1, CAST(DateAdd(Month, -6, GETDATE()) AS DATE))
|
||||
OR (EvaluationDateTime >= DATEADD(d,-day(DateAdd(Month, -6, GETDATE()))+1, CAST(DateAdd(Month, -6, GETDATE()) AS DATE))
|
||||
AND @DateMonth = '1900-01-01'))</CommandText>
|
||||
<rd:UseGenericDesigner>true</rd:UseGenericDesigner>
|
||||
</Query>
|
||||
@@ -173,24 +173,24 @@ AND @DateMonth = '1900-01-01'))</CommandText>
|
||||
<Value>=Parameters!ServerGroupName.Value</Value>
|
||||
</QueryParameter>
|
||||
</QueryParameters>
|
||||
<CommandText>SELECT CASE
|
||||
WHEN EXISTS
|
||||
(SELECT *
|
||||
FROM policy.v_PolicyHistory_LastEvaluation iple
|
||||
<CommandText>SELECT CASE
|
||||
WHEN EXISTS
|
||||
(SELECT *
|
||||
FROM policy.v_PolicyHistory_LastEvaluation iple
|
||||
WHERE iple.EvaluatedServer = ple.EvaluatedServer
|
||||
AND iple.CategoryName IN (@CategoryName)
|
||||
AND iple.EvaluatedPolicy IN (@EvaluatedPolicy)
|
||||
AND iple.PolicyResult = 'FAIL')
|
||||
THEN 'Out of Compliance'
|
||||
WHEN EXISTS
|
||||
(SELECT *
|
||||
FROM policy.v_PolicyHistory_LastEvaluation iple
|
||||
WHEN EXISTS
|
||||
(SELECT *
|
||||
FROM policy.v_PolicyHistory_LastEvaluation iple
|
||||
WHERE iple.EvaluatedServer = ple.EvaluatedServer
|
||||
AND iple.CategoryName IN (@CategoryName)
|
||||
AND iple.EvaluatedPolicy IN (@EvaluatedPolicy)
|
||||
AND iple.PolicyResult = 'ERROR')
|
||||
THEN 'Unknown'
|
||||
ELSE 'In Compliance'
|
||||
ELSE 'In Compliance'
|
||||
END AS InstanceStatus
|
||||
, EvaluatedServer
|
||||
FROM policy.v_PolicyHistory ple
|
||||
@@ -1402,7 +1402,7 @@ Sum(IIF(Fields!PolicyResult.Value="FAIL", 1, 0))/COUNT(Fields!PolicyResult.Value
|
||||
<Paragraph>
|
||||
<TextRuns>
|
||||
<TextRun>
|
||||
<Value>=SUM(SWITCH(Fields!PolicyResult.Value= "FAIL", 1,
|
||||
<Value>=SUM(SWITCH(Fields!PolicyResult.Value= "FAIL", 1,
|
||||
Fields!PolicyResult.Value= "ERROR", 1,
|
||||
Fields!PolicyResult.Value= "PASS", 0))</Value>
|
||||
<Style>
|
||||
@@ -1450,7 +1450,7 @@ Fields!PolicyResult.Value= "PASS", 0))</Value>
|
||||
<Style>
|
||||
<FontFamily>Segoe UI</FontFamily>
|
||||
<FontSize>9pt</FontSize>
|
||||
<Color>=SWITCH(Fields!PolicyResult.Value = "FAIL", "Firebrick",
|
||||
<Color>=SWITCH(Fields!PolicyResult.Value = "FAIL", "Firebrick",
|
||||
Fields!PolicyResult.Value = "ERROR", "Red",
|
||||
Fields!PolicyResult.Value = "PASS", "Black")</Color>
|
||||
</Style>
|
||||
@@ -1503,7 +1503,7 @@ Fields!PolicyResult.Value = "PASS", "Black")</Color>
|
||||
<Style>
|
||||
<FontFamily>Segoe UI</FontFamily>
|
||||
<FontSize>9pt</FontSize>
|
||||
<Color>=SWITCH(Fields!PolicyResult.Value = "FAIL", "Firebrick",
|
||||
<Color>=SWITCH(Fields!PolicyResult.Value = "FAIL", "Firebrick",
|
||||
Fields!PolicyResult.Value = "ERROR", "Red",
|
||||
Fields!PolicyResult.Value = "PASS", "Black")</Color>
|
||||
</Style>
|
||||
@@ -1560,7 +1560,7 @@ Fields!PolicyResult.Value = "PASS", "Black")</Color>
|
||||
<FontFamily>Segoe UI</FontFamily>
|
||||
<FontSize>9pt</FontSize>
|
||||
<Format>g</Format>
|
||||
<Color>=SWITCH(Fields!PolicyResult.Value = "FAIL", "Firebrick",
|
||||
<Color>=SWITCH(Fields!PolicyResult.Value = "FAIL", "Firebrick",
|
||||
Fields!PolicyResult.Value = "ERROR", "Red",
|
||||
Fields!PolicyResult.Value = "PASS", "Black")</Color>
|
||||
</Style>
|
||||
@@ -1601,7 +1601,7 @@ Fields!PolicyResult.Value = "PASS", "Black")</Color>
|
||||
<Style>
|
||||
<FontFamily>Segoe UI</FontFamily>
|
||||
<FontSize>9pt</FontSize>
|
||||
<Color>=SWITCH(Fields!PolicyResult.Value = "FAIL", "Firebrick",
|
||||
<Color>=SWITCH(Fields!PolicyResult.Value = "FAIL", "Firebrick",
|
||||
Fields!PolicyResult.Value = "ERROR", "Red",
|
||||
Fields!PolicyResult.Value = "PASS", "Black")</Color>
|
||||
</Style>
|
||||
@@ -1658,7 +1658,7 @@ Fields!PolicyResult.Value = "PASS", "Black")</Color>
|
||||
<Style>
|
||||
<FontFamily>Segoe UI</FontFamily>
|
||||
<FontSize>9pt</FontSize>
|
||||
<Color>=SWITCH(Fields!PolicyResult.Value = "FAIL", "Firebrick",
|
||||
<Color>=SWITCH(Fields!PolicyResult.Value = "FAIL", "Firebrick",
|
||||
Fields!PolicyResult.Value = "ERROR", "Red",
|
||||
Fields!PolicyResult.Value = "PASS", "Black")</Color>
|
||||
</Style>
|
||||
@@ -1694,7 +1694,7 @@ Fields!PolicyResult.Value = "PASS", "Black")</Color>
|
||||
<Style>
|
||||
<FontFamily>Segoe UI</FontFamily>
|
||||
<FontSize>9pt</FontSize>
|
||||
<Color>=SWITCH(Fields!PolicyResult.Value = "FAIL", "Firebrick",
|
||||
<Color>=SWITCH(Fields!PolicyResult.Value = "FAIL", "Firebrick",
|
||||
Fields!PolicyResult.Value = "ERROR", "Red",
|
||||
Fields!PolicyResult.Value = "PASS", "Black")</Color>
|
||||
</Style>
|
||||
|
||||
+30
-30
@@ -27,18 +27,18 @@
|
||||
<Value>=Parameters!Object.Value</Value>
|
||||
</QueryParameter>
|
||||
</QueryParameters>
|
||||
<CommandText>SELECT
|
||||
<CommandText>SELECT
|
||||
*
|
||||
,SUBSTRING (AggEvaluatedObject, 0, CHARINDEX('\',AggEvaluatedObject)) AggEvaluatedObject_First
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
SELECT
|
||||
EvaluatedServer
|
||||
, EvaluationDateTime
|
||||
, EvaluatedPolicy
|
||||
, EvaluatedObject
|
||||
, CASE WHEN EvaluatedObject LIKE '%Databases\%\' THEN RIGHT(EvaluatedObject, CHARINDEX('\sesabataD',REVERSE(EvaluatedObject))-1)
|
||||
WHEN EvaluatedObject LIKE '%Databases\%' THEN RIGHT(EvaluatedObject, CHARINDEX('\sesabataD',REVERSE(EvaluatedObject))-1) + '\'
|
||||
, CASE WHEN EvaluatedObject LIKE '%Databases\%\' THEN RIGHT(EvaluatedObject, CHARINDEX('\sesabataD',REVERSE(EvaluatedObject))-1)
|
||||
WHEN EvaluatedObject LIKE '%Databases\%' THEN RIGHT(EvaluatedObject, CHARINDEX('\sesabataD',REVERSE(EvaluatedObject))-1) + '\'
|
||||
WHEN EvaluatedObject = 'No Targets Found' THEN EvaluatedObject + '\'
|
||||
ELSE RIGHT(EvaluatedObject, CHARINDEX('\',REVERSE(EvaluatedObject))-1) + '\' END AS AggEvaluatedObject
|
||||
, PolicyResult
|
||||
@@ -50,8 +50,8 @@ FROM
|
||||
WHERE CategoryName IN (@CategoryName)
|
||||
AND EvaluatedPolicy IN (@EvaluatedPolicy)
|
||||
AND EvaluatedServer IN (@ServerName)
|
||||
AND EvaluatedPolicy NOT IN (SELECT spp.name
|
||||
FROM msdb..syspolicy_policies spp
|
||||
AND EvaluatedPolicy NOT IN (SELECT spp.name
|
||||
FROM msdb..syspolicy_policies spp
|
||||
INNER JOIN msdb..syspolicy_policy_categories spc ON spp.policy_category_id = spc.policy_category_id
|
||||
WHERE spc.name = 'Disabled')
|
||||
) A
|
||||
@@ -173,9 +173,9 @@ AND EvaluatedPolicy IN (@EvaluatedPolicy)
|
||||
AND (EvaluatedServer IN (SELECT server_name
|
||||
FROM policy.pfn_ServerGroupInstances(@ServerGroupName))
|
||||
OR @ServerGroupName = '')
|
||||
AND (EvaluationDateTime >= DATEADD(d,-day(DateAdd(Month, -6, @DateMonth))+1, CAST(DateAdd(Month, -6, @DateMonth) AS DATE))
|
||||
AND (EvaluationDateTime >= DATEADD(d,-day(DateAdd(Month, -6, @DateMonth))+1, CAST(DateAdd(Month, -6, @DateMonth) AS DATE))
|
||||
AND EvaluationDateTime < DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,@DateMonth)+1,0))
|
||||
OR (EvaluationDateTime >= DATEADD(d,-day(DateAdd(Month, -6, GETDATE()))+1, CAST(DateAdd(Month, -6, GETDATE()) AS DATE))
|
||||
OR (EvaluationDateTime >= DATEADD(d,-day(DateAdd(Month, -6, GETDATE()))+1, CAST(DateAdd(Month, -6, GETDATE()) AS DATE))
|
||||
AND @DateMonth = '1900-01-01'))</CommandText>
|
||||
<rd:UseGenericDesigner>true</rd:UseGenericDesigner>
|
||||
</Query>
|
||||
@@ -209,24 +209,24 @@ AND @DateMonth = '1900-01-01'))</CommandText>
|
||||
<Value>=Parameters!ServerGroupName.Value</Value>
|
||||
</QueryParameter>
|
||||
</QueryParameters>
|
||||
<CommandText>SELECT CASE
|
||||
WHEN EXISTS
|
||||
(SELECT *
|
||||
FROM policy.v_PolicyHistory_LastEvaluation iple
|
||||
<CommandText>SELECT CASE
|
||||
WHEN EXISTS
|
||||
(SELECT *
|
||||
FROM policy.v_PolicyHistory_LastEvaluation iple
|
||||
WHERE iple.EvaluatedServer = ple.EvaluatedServer
|
||||
AND iple.CategoryName IN (@CategoryName)
|
||||
AND iple.EvaluatedPolicy IN (@EvaluatedPolicy)
|
||||
AND iple.PolicyResult = 'FAIL')
|
||||
THEN 'Out of Compliance'
|
||||
WHEN EXISTS
|
||||
(SELECT *
|
||||
FROM policy.v_PolicyHistory_LastEvaluation iple
|
||||
WHEN EXISTS
|
||||
(SELECT *
|
||||
FROM policy.v_PolicyHistory_LastEvaluation iple
|
||||
WHERE iple.EvaluatedServer = ple.EvaluatedServer
|
||||
AND iple.CategoryName IN (@CategoryName)
|
||||
AND iple.EvaluatedPolicy IN (@EvaluatedPolicy)
|
||||
AND iple.PolicyResult = 'ERROR')
|
||||
THEN 'Unknown'
|
||||
ELSE 'In Compliance'
|
||||
ELSE 'In Compliance'
|
||||
END AS InstanceStatus
|
||||
, EvaluatedServer
|
||||
FROM policy.v_PolicyHistory ple
|
||||
@@ -325,7 +325,7 @@ WHERE CategoryName IN (@CategoryName)</CommandText>
|
||||
</QueryParameters>
|
||||
<CommandText>SELECT DISTINCT [EvaluatedServer]
|
||||
FROM [policy].[PolicyHistoryDetail]
|
||||
WHERE
|
||||
WHERE
|
||||
(EvaluatedServer COLLATE SQL_Latin1_General_CP1_CI_AI IN (SELECT server_name FROM policy.pfn_ServerGroupInstances(@ServerGroupName))
|
||||
OR @ServerGroupName = '')
|
||||
ORDER BY [EvaluatedServer]</CommandText>
|
||||
@@ -349,15 +349,15 @@ ORDER BY [EvaluatedServer]</CommandText>
|
||||
SUBSTRING (AggEvaluatedObject, 0, CHARINDEX('\',AggEvaluatedObject)) AggEvaluatedObject_First
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
CASE
|
||||
WHEN EvaluatedObject LIKE '%Databases\%\' THEN RIGHT(EvaluatedObject, CHARINDEX('\sesabataD',REVERSE(EvaluatedObject))-1)
|
||||
WHEN EvaluatedObject LIKE '%Databases\%' THEN RIGHT(EvaluatedObject, CHARINDEX('\sesabataD',REVERSE(EvaluatedObject))-1) + '\'
|
||||
SELECT
|
||||
CASE
|
||||
WHEN EvaluatedObject LIKE '%Databases\%\' THEN RIGHT(EvaluatedObject, CHARINDEX('\sesabataD',REVERSE(EvaluatedObject))-1)
|
||||
WHEN EvaluatedObject LIKE '%Databases\%' THEN RIGHT(EvaluatedObject, CHARINDEX('\sesabataD',REVERSE(EvaluatedObject))-1) + '\'
|
||||
WHEN EvaluatedObject = 'No Targets Found' THEN EvaluatedObject + '\'
|
||||
ELSE RIGHT(EvaluatedObject, CHARINDEX('\',REVERSE(EvaluatedObject))-1) + '\'
|
||||
ELSE RIGHT(EvaluatedObject, CHARINDEX('\',REVERSE(EvaluatedObject))-1) + '\'
|
||||
END AS AggEvaluatedObject
|
||||
FROM [policy].[PolicyHistoryDetail]
|
||||
WHERE
|
||||
WHERE
|
||||
EvaluatedServer IN (@ServerName)
|
||||
) A
|
||||
ORDER BY AggEvaluatedObject_First</CommandText>
|
||||
@@ -1492,7 +1492,7 @@ Sum(IIF(Fields!PolicyResult.Value="FAIL", 1, 0))/COUNT(Fields!PolicyResult.Value
|
||||
<Paragraph>
|
||||
<TextRuns>
|
||||
<TextRun>
|
||||
<Value>=SUM(SWITCH(Fields!PolicyResult.Value= "FAIL", 1,
|
||||
<Value>=SUM(SWITCH(Fields!PolicyResult.Value= "FAIL", 1,
|
||||
Fields!PolicyResult.Value= "ERROR", 1,
|
||||
Fields!PolicyResult.Value= "PASS", 0))</Value>
|
||||
<Style>
|
||||
@@ -1540,7 +1540,7 @@ Fields!PolicyResult.Value= "PASS", 0))</Value>
|
||||
<Style>
|
||||
<FontFamily>Segoe UI</FontFamily>
|
||||
<FontSize>9pt</FontSize>
|
||||
<Color>=SWITCH(Fields!PolicyResult.Value = "FAIL", "Firebrick",
|
||||
<Color>=SWITCH(Fields!PolicyResult.Value = "FAIL", "Firebrick",
|
||||
Fields!PolicyResult.Value = "ERROR", "Red",
|
||||
Fields!PolicyResult.Value = "PASS", "Black")</Color>
|
||||
</Style>
|
||||
@@ -1593,7 +1593,7 @@ Fields!PolicyResult.Value = "PASS", "Black")</Color>
|
||||
<Style>
|
||||
<FontFamily>Segoe UI</FontFamily>
|
||||
<FontSize>9pt</FontSize>
|
||||
<Color>=SWITCH(Fields!PolicyResult.Value = "FAIL", "Firebrick",
|
||||
<Color>=SWITCH(Fields!PolicyResult.Value = "FAIL", "Firebrick",
|
||||
Fields!PolicyResult.Value = "ERROR", "Red",
|
||||
Fields!PolicyResult.Value = "PASS", "Black")</Color>
|
||||
</Style>
|
||||
@@ -1650,7 +1650,7 @@ Fields!PolicyResult.Value = "PASS", "Black")</Color>
|
||||
<FontFamily>Segoe UI</FontFamily>
|
||||
<FontSize>9pt</FontSize>
|
||||
<Format>g</Format>
|
||||
<Color>=SWITCH(Fields!PolicyResult.Value = "FAIL", "Firebrick",
|
||||
<Color>=SWITCH(Fields!PolicyResult.Value = "FAIL", "Firebrick",
|
||||
Fields!PolicyResult.Value = "ERROR", "Red",
|
||||
Fields!PolicyResult.Value = "PASS", "Black")</Color>
|
||||
</Style>
|
||||
@@ -1691,7 +1691,7 @@ Fields!PolicyResult.Value = "PASS", "Black")</Color>
|
||||
<Style>
|
||||
<FontFamily>Segoe UI</FontFamily>
|
||||
<FontSize>9pt</FontSize>
|
||||
<Color>=SWITCH(Fields!PolicyResult.Value = "FAIL", "Firebrick",
|
||||
<Color>=SWITCH(Fields!PolicyResult.Value = "FAIL", "Firebrick",
|
||||
Fields!PolicyResult.Value = "ERROR", "Red",
|
||||
Fields!PolicyResult.Value = "PASS", "Black")</Color>
|
||||
</Style>
|
||||
@@ -1748,7 +1748,7 @@ Fields!PolicyResult.Value = "PASS", "Black")</Color>
|
||||
<Style>
|
||||
<FontFamily>Segoe UI</FontFamily>
|
||||
<FontSize>9pt</FontSize>
|
||||
<Color>=SWITCH(Fields!PolicyResult.Value = "FAIL", "Firebrick",
|
||||
<Color>=SWITCH(Fields!PolicyResult.Value = "FAIL", "Firebrick",
|
||||
Fields!PolicyResult.Value = "ERROR", "Red",
|
||||
Fields!PolicyResult.Value = "PASS", "Black")</Color>
|
||||
</Style>
|
||||
@@ -1784,7 +1784,7 @@ Fields!PolicyResult.Value = "PASS", "Black")</Color>
|
||||
<Style>
|
||||
<FontFamily>Segoe UI</FontFamily>
|
||||
<FontSize>9pt</FontSize>
|
||||
<Color>=SWITCH(Fields!PolicyResult.Value = "FAIL", "Firebrick",
|
||||
<Color>=SWITCH(Fields!PolicyResult.Value = "FAIL", "Firebrick",
|
||||
Fields!PolicyResult.Value = "ERROR", "Red",
|
||||
Fields!PolicyResult.Value = "PASS", "Black")</Color>
|
||||
</Style>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<Value>=Parameters!pid.Value</Value>
|
||||
</QueryParameter>
|
||||
</QueryParameters>
|
||||
<CommandText>SELECT p.policy_id, c.name AS cName, p.name AS pName, p.date_created, p.created_by, p.date_modified, p.modified_by, p.description, p.help_text, p.help_link, p.is_enabled,
|
||||
<CommandText>SELECT p.policy_id, c.name AS cName, p.name AS pName, p.date_created, p.created_by, p.date_modified, p.modified_by, p.description, p.help_text, p.help_link, p.is_enabled,
|
||||
c.policy_category_id
|
||||
FROM msdb.dbo.syspolicy_policies AS p INNER JOIN
|
||||
msdb.dbo.syspolicy_policy_categories AS c ON p.policy_category_id = c.policy_category_id
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
, EvaluationDateTime
|
||||
, EvaluatedPolicy
|
||||
, EvaluatedObject
|
||||
, CASE WHEN EvaluatedObject LIKE '%Databases\%\' THEN RIGHT(EvaluatedObject, CHARINDEX('\sesabataD',REVERSE(EvaluatedObject))-1)
|
||||
WHEN EvaluatedObject LIKE '%Databases\%' THEN RIGHT(EvaluatedObject, CHARINDEX('\sesabataD',REVERSE(EvaluatedObject))-1) + '\'
|
||||
, CASE WHEN EvaluatedObject LIKE '%Databases\%\' THEN RIGHT(EvaluatedObject, CHARINDEX('\sesabataD',REVERSE(EvaluatedObject))-1)
|
||||
WHEN EvaluatedObject LIKE '%Databases\%' THEN RIGHT(EvaluatedObject, CHARINDEX('\sesabataD',REVERSE(EvaluatedObject))-1) + '\'
|
||||
WHEN EvaluatedObject = 'No Targets Found' THEN EvaluatedObject + '\'
|
||||
ELSE RIGHT(EvaluatedObject, CHARINDEX('\',REVERSE(EvaluatedObject))-1) + '\' END AS AggEvaluatedObject
|
||||
, PolicyResult
|
||||
@@ -43,8 +43,8 @@ AND EvaluatedPolicy IN (@EvaluatedPolicy)
|
||||
AND (EvaluatedServer IN (SELECT server_name
|
||||
FROM policy.pfn_ServerGroupInstances(@ServerGroupName))
|
||||
OR @ServerGroupName = '')
|
||||
AND EvaluatedPolicy NOT IN (SELECT spp.name
|
||||
FROM msdb..syspolicy_policies spp
|
||||
AND EvaluatedPolicy NOT IN (SELECT spp.name
|
||||
FROM msdb..syspolicy_policies spp
|
||||
INNER JOIN msdb..syspolicy_policy_categories spc ON spp.policy_category_id = spc.policy_category_id
|
||||
WHERE spc.name = 'Disabled')
|
||||
ORDER BY PolicyResult, EvaluatedServer</CommandText>
|
||||
|
||||
+7
-7
@@ -5,8 +5,8 @@ EXEC msdb.dbo.sp_syspolicy_rename_condition @name = N'SQL Server 2005 or a Later
|
||||
GO
|
||||
|
||||
/*
|
||||
Notes:
|
||||
Remove from "Surface Area Configuration for Database Engine 2005 and 2000 Features" condition all 2005 only features.
|
||||
Notes:
|
||||
Remove from "Surface Area Configuration for Database Engine 2005 and 2000 Features" condition all 2005 only features.
|
||||
Then change "Surface Area Configuration for Database Engine 2008 Features" to apply from SQL 2005 onwards, otherwise policy evaluation fails.
|
||||
*/
|
||||
|
||||
@@ -140,7 +140,7 @@ EXEC msdb.dbo.sp_syspolicy_update_policy @name='Public Not Granted Server Permis
|
||||
GO
|
||||
|
||||
-- Fix typos or extra white spaces in descriptions
|
||||
EXEC msdb.dbo.sp_syspolicy_update_policy @name='SQL Server Affinity Mask', @description=N'Checks an instance of SQL Server for setting, affinity mask to its default value 0, since in most cases, the Microsoft Windows 2000 or Windows Server 2003 default affinity provides the best performance.
|
||||
EXEC msdb.dbo.sp_syspolicy_update_policy @name='SQL Server Affinity Mask', @description=N'Checks an instance of SQL Server for setting, affinity mask to its default value 0, since in most cases, the Microsoft Windows 2000 or Windows Server 2003 default affinity provides the best performance.
|
||||
Confirms whether the setting affinity mask of server is set to zero.'
|
||||
GO
|
||||
|
||||
@@ -153,7 +153,7 @@ EXEC msdb.dbo.sp_syspolicy_update_policy @name='Windows Event Log Cluster Disk R
|
||||
http://support.microsoft.com/kb/311081'
|
||||
GO
|
||||
|
||||
EXEC msdb.dbo.sp_syspolicy_update_policy @name='Windows Event Log Device Driver Control Error', @description=N'Detects Error EventID –11 in the System Log. This error could be because of a corrupted device driver, a hardware problem, a malfunctioning device, poor cabling, or termination issues.
|
||||
EXEC msdb.dbo.sp_syspolicy_update_policy @name='Windows Event Log Device Driver Control Error', @description=N'Detects Error EventID �11 in the System Log. This error could be because of a corrupted device driver, a hardware problem, a malfunctioning device, poor cabling, or termination issues.
|
||||
http://support.microsoft.com/kb/259237
|
||||
http://support.microsoft.com/kb/154690'
|
||||
GO
|
||||
@@ -174,11 +174,11 @@ http://support.microsoft.com/kb/885688'
|
||||
GO
|
||||
|
||||
EXEC msdb.dbo.sp_syspolicy_update_policy @name='Windows Event Log I/O Error During Hard Page Fault Error', @description=N'Detects I/O Error during hard page fault in System Log.
|
||||
http://support.microsoft.com/kb/304415
|
||||
http://support.microsoft.com/kb/304415
|
||||
http://support.microsoft.com/kb/305547'
|
||||
GO
|
||||
|
||||
EXEC msdb.dbo.sp_syspolicy_update_policy @name='Windows Event Log Storage System I/O Timeout Error', @description=N'Detects Error EventID –9 in the System Log. This error indicates that I/O time-out has occurred within the storage system, as detected from the driver for the controller.
|
||||
http://support.microsoft.com/kb/259237
|
||||
EXEC msdb.dbo.sp_syspolicy_update_policy @name='Windows Event Log Storage System I/O Timeout Error', @description=N'Detects Error EventID �9 in the System Log. This error indicates that I/O time-out has occurred within the storage system, as detected from the driver for the controlle
|
||||
http://support.microsoft.com/kb/259237
|
||||
http://support.microsoft.com/kb/154690'
|
||||
GO
|
||||
+41
-41
@@ -1,15 +1,15 @@
|
||||
/*
|
||||
This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
|
||||
THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
|
||||
INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute
|
||||
the object code form of the Sample Code, provided that You agree:
|
||||
(i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded;
|
||||
(ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and
|
||||
(iii) to indentify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,
|
||||
This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
|
||||
THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
|
||||
INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
We grant You a nonexclusive, royalty-free right to use and modify the Sample Code and to reproduce and distribute
|
||||
the object code form of the Sample Code, provided that You agree:
|
||||
(i) to not use Our name, logo, or trademarks to market Your software product in which the Sample Code is embedded;
|
||||
(ii) to include a valid copyright notice on Your software product in which the Sample Code is embedded; and
|
||||
(iii) to indentify, hold harmless, and defend Us and Our suppliers from and against any claims or lawsuits,
|
||||
including attorneys' fees, that arise or result from the use or distribution of the Sample Code.
|
||||
|
||||
Please note: None of the conditions outlined in the disclaimer above will supersede the terms and
|
||||
Please note: None of the conditions outlined in the disclaimer above will supersede the terms and
|
||||
conditions contained within the Premier Customer Services Description.
|
||||
|
||||
*/
|
||||
@@ -19,21 +19,21 @@ GO
|
||||
|
||||
--------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--POLICY CATEGORY: Name Pattern
|
||||
DECLARE @policy_category_id int;
|
||||
DECLARE @policy_category_id int;
|
||||
|
||||
SELECT @policy_category_id = policy_category_id FROM dbo.syspolicy_policy_categories where name = N'Name_Pattern'
|
||||
SELECT @policy_category_id = policy_category_id FROM dbo.syspolicy_policy_categories where name = N'Name_Pattern'
|
||||
|
||||
IF (@policy_category_id IS NULL)
|
||||
BEGIN
|
||||
EXEC msdb.dbo.sp_syspolicy_add_policy_category
|
||||
@name = N'Name_Pattern'
|
||||
EXEC msdb.dbo.sp_syspolicy_add_policy_category
|
||||
@name = N'Name_Pattern'
|
||||
, @mandate_database_subscriptions = 1
|
||||
, @policy_category_id = @policy_category_id OUTPUT;
|
||||
, @policy_category_id = @policy_category_id OUTPUT;
|
||||
END
|
||||
|
||||
SELECT @policy_category_id as NEW_policy_category_id
|
||||
|
||||
GO
|
||||
GO
|
||||
/*
|
||||
--------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--DELETE ALL POLICIES
|
||||
@@ -41,22 +41,22 @@ DECLARE @policy_id INT
|
||||
|
||||
DECLARE CURSOR_POLICIES_TO_DELETE CURSOR FAST_FORWARD FOR
|
||||
SELECT policy_id FROM dbo.syspolicy_policies P
|
||||
INNER JOIN dbo.syspolicy_policy_categories PC
|
||||
INNER JOIN dbo.syspolicy_policy_categories PC
|
||||
ON P.policy_category_id = PC.policy_category_id
|
||||
WHERE PC.[name] = N'Name_Pattern'
|
||||
|
||||
OPEN CURSOR_POLICIES_TO_DELETE
|
||||
OPEN CURSOR_POLICIES_TO_DELETE
|
||||
|
||||
FETCH NEXT FROM CURSOR_POLICIES_TO_DELETE
|
||||
INTO @policy_id
|
||||
FETCH NEXT FROM CURSOR_POLICIES_TO_DELETE
|
||||
INTO @policy_id
|
||||
|
||||
WHILE @@FETCH_STATUS = 0
|
||||
BEGIN
|
||||
WHILE @@FETCH_STATUS = 0
|
||||
BEGIN
|
||||
EXEC msdb.dbo.sp_syspolicy_delete_policy @policy_id=@policy_id
|
||||
|
||||
FETCH NEXT FROM CURSOR_POLICIES_TO_DELETE
|
||||
INTO @policy_id
|
||||
END
|
||||
FETCH NEXT FROM CURSOR_POLICIES_TO_DELETE
|
||||
INTO @policy_id
|
||||
END
|
||||
CLOSE CURSOR_POLICIES_TO_DELETE
|
||||
DEALLOCATE CURSOR_POLICIES_TO_DELETE
|
||||
|
||||
@@ -72,13 +72,13 @@ DECLARE @target_set_id INT
|
||||
DECLARE CURSOR_OBJECTS_SETS_TO_DELETE CURSOR FAST_FORWARD FOR
|
||||
SELECT object_set_id FROM dbo.syspolicy_object_sets where is_system = 0
|
||||
|
||||
OPEN CURSOR_OBJECTS_SETS_TO_DELETE
|
||||
OPEN CURSOR_OBJECTS_SETS_TO_DELETE
|
||||
|
||||
FETCH NEXT FROM CURSOR_OBJECTS_SETS_TO_DELETE
|
||||
INTO @object_set_id
|
||||
FETCH NEXT FROM CURSOR_OBJECTS_SETS_TO_DELETE
|
||||
INTO @object_set_id
|
||||
|
||||
WHILE @@FETCH_STATUS = 0
|
||||
BEGIN
|
||||
WHILE @@FETCH_STATUS = 0
|
||||
BEGIN
|
||||
BEGIN TRY
|
||||
|
||||
EXEC msdb.dbo.sp_syspolicy_delete_object_set @object_set_id=@object_set_id
|
||||
@@ -95,9 +95,9 @@ BEGIN
|
||||
PRINT ERROR_MESSAGE()
|
||||
END CATCH
|
||||
|
||||
FETCH NEXT FROM CURSOR_OBJECTS_SETS_TO_DELETE
|
||||
INTO @object_set_id
|
||||
END
|
||||
FETCH NEXT FROM CURSOR_OBJECTS_SETS_TO_DELETE
|
||||
INTO @object_set_id
|
||||
END
|
||||
CLOSE CURSOR_OBJECTS_SETS_TO_DELETE
|
||||
DEALLOCATE CURSOR_OBJECTS_SETS_TO_DELETE
|
||||
|
||||
@@ -112,13 +112,13 @@ DECLARE @condition_id INT
|
||||
DECLARE CURSOR_CONDITIONS_TO_DELETE CURSOR FAST_FORWARD FOR
|
||||
SELECT condition_id FROM dbo.syspolicy_conditions where is_system = 0
|
||||
|
||||
OPEN CURSOR_CONDITIONS_TO_DELETE
|
||||
OPEN CURSOR_CONDITIONS_TO_DELETE
|
||||
|
||||
FETCH NEXT FROM CURSOR_CONDITIONS_TO_DELETE
|
||||
INTO @condition_id
|
||||
FETCH NEXT FROM CURSOR_CONDITIONS_TO_DELETE
|
||||
INTO @condition_id
|
||||
|
||||
WHILE @@FETCH_STATUS = 0
|
||||
BEGIN
|
||||
WHILE @@FETCH_STATUS = 0
|
||||
BEGIN
|
||||
BEGIN TRY
|
||||
EXEC msdb.dbo.sp_syspolicy_delete_condition @condition_id=@condition_id
|
||||
SELECT 'DELETE @condition_id', @condition_id
|
||||
@@ -127,9 +127,9 @@ BEGIN
|
||||
PRINT ERROR_MESSAGE()
|
||||
END CATCH
|
||||
|
||||
FETCH NEXT FROM CURSOR_CONDITIONS_TO_DELETE
|
||||
INTO @condition_id
|
||||
END
|
||||
FETCH NEXT FROM CURSOR_CONDITIONS_TO_DELETE
|
||||
INTO @condition_id
|
||||
END
|
||||
CLOSE CURSOR_CONDITIONS_TO_DELETE
|
||||
DEALLOCATE CURSOR_CONDITIONS_TO_DELETE
|
||||
|
||||
@@ -991,6 +991,6 @@ GO
|
||||
|
||||
|
||||
SELECT P.policy_id, P.name, PC.name FROM dbo.syspolicy_policies P
|
||||
INNER JOIN dbo.syspolicy_policy_categories PC
|
||||
INNER JOIN dbo.syspolicy_policy_categories PC
|
||||
ON P.policy_category_id = PC.policy_category_id
|
||||
WHERE PC.[name] = N'Name_Pattern'
|
||||
|
||||
@@ -5,7 +5,7 @@ https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-ps-module
|
||||
|
||||
Over 4.12.1 below, EPM Framework 4.12.2 includes the following updates (as per received feedback): Fixed collation issues on views and reports
|
||||
|
||||
Over 4.12 below, EPM Framework 4.12.1 includes the following updates (as per received feedback):
|
||||
Over 4.12 below, EPM Framework 4.12.1 includes the following updates (as per received feedback):
|
||||
- Update documentation with PS security related information.
|
||||
- Added existence check conditions to "4FixImportedPolicies" to avoid errors when not all default policies were imported.
|
||||
- Fixed call to evaluation details sub-report not auto selecting policies, when called from "Failed Object Count by Policy Category" chart.
|
||||
@@ -16,23 +16,23 @@ Over 4.12 below, EPM Framework 4.12.1 includes the following updates (as per rec
|
||||
- Added call to evaluation details sub-report from "Objects in Failed State" value in the top-left of the Policy Dashboard.
|
||||
- In PBM_Custom.zip, corrected script calling in job creation script.
|
||||
|
||||
Over 4.11 below, EPM Framework 4.12 includes the following updates (as per received feedback):
|
||||
Over 4.11 below, EPM Framework 4.12 includes the following updates (as per received feedback):
|
||||
- Fixed issue with failed execution under SQL Agent PS job due to Write-Output.
|
||||
- Fixed issue with Invoke-PolicyEvaluation and null values.
|
||||
- Added resilience with different PS versions.
|
||||
- Added resilience with different PS versions.
|
||||
- Added server filtering options in PolicyEvaluationDetails and PolicyEvaluationErrors sub-reports.
|
||||
- In PBM_Custom.zip, fixed condition for "Enterprise Features" policy that generated evaluation errors.
|
||||
|
||||
Over 4.1 below, EPM Framework 4.11 includes the following updates (as per received feedback):
|
||||
Over 4.1 below, EPM Framework 4.11 includes the following updates (as per received feedback):
|
||||
- Fixed sub-reports deployment fail due to failed validation.
|
||||
- Fixed issue in Data Loading Stored Procedure.
|
||||
|
||||
The EPM Framework 4.1 includes the following updates:
|
||||
The EPM Framework 4.1 includes the following updates:
|
||||
- New PS script Improved resilience when running from CMS hosted on SQL Server 2008, 2008R2, 2012 and 2014.
|
||||
- Improved resilience when used with PS v2, v3 and v4.
|
||||
- Improved Data Loading Stored Procedure, where some policy results might not be loaded (this has been identified as active since EPM v3).
|
||||
|
||||
The EPM Framework 4.0 includes the following updates:
|
||||
The EPM Framework 4.0 includes the following updates:
|
||||
- For enhanced support of large environments Reviewed database design, including views and indexing.
|
||||
- Redesigned data load procedure.
|
||||
- PowerShell execution now deletes XML files as soon as load is done - improves space usage on temp folder.
|
||||
@@ -43,8 +43,8 @@ Tested from SQL Server 2000 to 2014.
|
||||
Note: an upgrade script for all the relevant database objects is provided, supporting direct upgrade from v3 and v4. Please check the documentation for further information.
|
||||
|
||||
We are also providing a set of scripts as an extension to the base set of Microsoft provided policies, and assumes the user has previously imported these Microsoft provided policies, as described by the "Configure/Create Policies and Centralize on the Central Management Server" section of the EPM Configuration Documentation.
|
||||
These scripts have some fixes for the Microsoft provided policies, and include extra policies:
|
||||
- Determining the if SQL Server instances are at the recommended SP level. Note that the condition has to be updated with proper build numbers for the policy to be current.
|
||||
These scripts have some fixes for the Microsoft provided policies, and include extra policies:
|
||||
- Determining the if SQL Server instances are at the recommended SP level. Note that the condition has to be updated with proper build numbers for the policy to be current.
|
||||
- Determining the if SQL Server instances are at the recommended CU or Hotfix. Note that the condition has to be updated with proper build numbers for the policy to be current.
|
||||
- Do I have log backups older than 24h?
|
||||
- Do I have full backups on read-write, full RM databases?
|
||||
@@ -57,7 +57,7 @@ These scripts have some fixes for the Microsoft provided policies, and include e
|
||||
- Do I have more VLFs than my rule-of-thumb? This has a 100 VLF threshold – change as appropriate.
|
||||
- Am I using Enterprise SKU features? Maybe I need to move a database to another server, and if it’s not an Enterprise Edition, so I must account for this?
|
||||
- Is Maximum Server Memory set at default? You will want to set this setting different from default.
|
||||
- Is Server Memory set at a fixed value?
|
||||
- Is Server Memory set at a fixed value?
|
||||
- Are DB Compatibility levels same as engine version?
|
||||
- Is Tempdb number of files appropriate? Regarding number of schedulers and if is multiple of 4?
|
||||
- Do TempDB data file sizes match?
|
||||
|
||||
Reference in New Issue
Block a user