Here's the code for identifying which reports are no longer inheriting permissions from their parent:
USE ReportServer
SELECT
[Path],
[Name]
FROM
[dbo].[Catalog]
WHERE
[PolicyRoot] = 1
USE ReportServer
SELECT
[Path],
[Name]
FROM
[dbo].[Catalog]
WHERE
[PolicyRoot] = 1
CREATE PROCEDURE [Monitoring].[sPerformanceCountersSelectByDateRange]
@FormerDate DATETIME,
@LatterDate DATETIME
AS
BEGIN
SELECT
DateTimeID
,DATETIME
,OBJECT_NAME
,counter_name
,instance_name
,cntr_value
,cntr_type
FROM
(
SELECT
DateTimeID
,DATETIME
,OBJECT_NAME
,counter_name
,instance_name
,cntr_value
,cntr_type
FROM
Monitoring.PerformanceCounters
WHERE
NOT PerformanceCounters.cntr_type IN (272696576,537003264,1073939712) --Cumulative and Ratio counters
UNION
SELECT --Cumulative Counters
CurrentPerformanceCounters.DateTimeID
,CurrentPerformanceCounters.DATETIME
,CurrentPerformanceCounters.OBJECT_NAME
,CurrentPerformanceCounters.counter_name
,CurrentPerformanceCounters.instance_name
,(CurrentPerformanceCounters.cntr_value-PreviousPerformanceCounters.cntr_value)/
DATEDIFF(ss,PreviousPerformanceCounters.DATETIME,CurrentPerformanceCounters.DATETIME) cntr_value
,CurrentPerformanceCounters.cntr_type
FROM
Monitoring.PerformanceCounters CurrentPerformanceCounters
JOIN
Monitoring.PerformanceCounters PreviousPerformanceCounters
ON CurrentPerformanceCounters.counter_name = PreviousPerformanceCounters.counter_name
AND CurrentPerformanceCounters.instance_name = PreviousPerformanceCounters.instance_name
AND CurrentPerformanceCounters.DateTimeID
= PreviousPerformanceCounters.DateTimeID
+ CASE RIGHT(CurrentPerformanceCounters.DateTimeID,2)
WHEN 00 THEN 45
ELSE 5
END
WHERE
CurrentPerformanceCounters.cntr_type = 272696576
UNION
SELECT --Ratio Counters
NumeratorPerformanceCounters.DateTimeID
,NumeratorPerformanceCounters.DATETIME
,NumeratorPerformanceCounters.OBJECT_NAME
,NumeratorPerformanceCounters.counter_name
,NumeratorPerformanceCounters.instance_name
,NumeratorPerformanceCounters.cntr_value/CAST(DenominatorPerformanceCounters.cntr_value AS FLOAT) cntr_value
,NumeratorPerformanceCounters.cntr_type
FROM
Monitoring.PerformanceCounters NumeratorPerformanceCounters
JOIN
Monitoring.PerformanceCounters DenominatorPerformanceCounters
ON DenominatorPerformanceCounters.cntr_type = 1073939712
AND NumeratorPerformanceCounters.DateTimeID = DenominatorPerformanceCounters.DateTimeID
AND NumeratorPerformanceCounters.instance_name = DenominatorPerformanceCounters.instance_name
WHERE
NumeratorPerformanceCounters.DATETIME BETWEEN @FormerDate
AND @LatterDate
AND NumeratorPerformanceCounters.cntr_type = 537003264
) AllResults
WHERE
AllResults.DATETIME BETWEEN @FormerDate
AND @LatterDate
END
----------------------------------------------------------------------------------------
--
-- Create a schema
--
----------------------------------------------------------------------------------------
CREATE SCHEMA [Monitoring];
----------------------------------------------------------------------------------------
--
-- Create a table for the stats to live in
--
----------------------------------------------------------------------------------------
CREATE TABLE [Monitoring].[PerformanceCounters](
[DateTimeID] [bigint] NOT NULL,
[DateTime] [datetime] NOT NULL,
[object_name] [nvarchar](128) NOT NULL,
[counter_name] [nvarchar](128) NOT NULL,
[instance_name] [nvarchar](128) NULL,
[cntr_value] [bigint] NULL,
[cntr_type] [int] NULL,
CONSTRAINT [pkPerformanceCounters] PRIMARY KEY CLUSTERED
(
[DateTimeID] ASC,
[counter_name] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
----------------------------------------------------------------------------------------
--
-- Create a procedure which will query the DMVs and store the results for reporting
--
----------------------------------------------------------------------------------------
CREATE PROCEDURE [Monitoring].[sPerformanceCountersInsert]
AS
BEGIN
INSERT INTO
[Monitoring].[PerformanceCounters]
SELECT
CAST(DATEPART(YEAR, GETDATE()) AS bigint)*100000000+
DATEPART(MONTH, GETDATE())*1000000+
DATEPART(DAY, GETDATE())*10000+
DATEPART(hour, GETDATE())*100+
DATEPART(minute, GETDATE()),
GETDATE(),
[dm_os_performance_counters].[object_name],
[dm_os_performance_counters].[counter_name],
[dm_os_performance_counters].[instance_name],
[dm_os_performance_counters].[cntr_value],
[dm_os_performance_counters].[cntr_type]
FROM
[TheDBYouWantToMonitor].[sys].[dm_os_performance_counters]
WHERE
(
OBJECT_NAME = 'SQLServer:Buffer Manager'
AND (
counter_name = 'Page life expectancy'
)
)
OR (
OBJECT_NAME = 'SQLServer:General Statistics'
AND (
counter_name = 'User Connections'
OR counter_name = 'Processes blocked'
)
)
OR (
OBJECT_NAME = 'SQLServer:Databases'
AND instance_name = 'TheDBYouWantToMonitor'
AND (
counter_name = 'Transactions/sec'
)
)
OR (
OBJECT_NAME = 'SQLServer:Access Methods'
AND (
counter_name = 'Full Scans/sec'
OR counter_name = 'Range Scans/sec'
OR counter_name = 'Index Searches/sec'
OR counter_name = 'Page Splits/sec'
OR counter_name = 'Table Lock Escalations/sec'
)
)
OR (
OBJECT_NAME = 'SQLServer:SQL Statistics'
AND counter_name = 'SQL Re-Compilations/sec'
)
OR (
OBJECT_NAME = 'SQLServer:Memory Manager'
AND counter_name = 'Memory Grants Outstanding'
)
OR (
OBJECT_NAME = 'SQLServer:Transactions'
AND counter_name = 'Transactions'
)
END
CREATE PROCEDURE [Monitoring].[sPerformanceCountersSelectByDateRange]
@FormerDate DATETIME,
@LatterDate DATETIME
AS
BEGIN
SELECT
[DateTimeID]
,[DateTime]
,[object_name]
,[counter_name]
,[instance_name]
,[cntr_value]
,[cntr_type]
FROM
[Monitoring].[PerformanceCounters]
WHERE
[DateTime] BETWEEN @FormerDate
AND @LatterDate
END
USE ReportServer
SELECT
sysjobs.name,
'RS - '
+ Catalog.Name
+ ' ['
+ CASE
WHEN DaysOfMonth IS NOT NULL
THEN CAST(DaysOfMonth AS VARCHAR(10)) + ' Day of Month'
WHEN DaysOfWeek = 1 THEN 'Monday'
WHEN DaysOfWeek = 2 THEN 'Tuesday'
WHEN DaysOfWeek = 4 THEN 'Wednesday'
WHEN DaysOfWeek = 8 THEN 'Thursday'
WHEN DaysOfWeek = 16 THEN 'Friday'
WHEN DaysOfWeek = 32 THEN 'Saturday'
WHEN DaysOfWeek = 64 THEN 'Sunday'
WHEN DaysOfWeek = 62 THEN 'Monday - Friday'
WHEN DaysOfWeek = 120 THEN 'Wednesday - Saturday'
WHEN DaysOfWeek = 126 THEN 'Monday - Saturday'
WHEN DaysOfWeek = 127 THEN 'Daily'
END
+ ' '
+ CAST(DATEPART(hh,Schedule.StartDate)AS VARCHAR(2))
+ CASE
WHEN LEN(CAST(DATEPART(n,Schedule.StartDate)AS VARCHAR(2))) = 1
THEN ':0' + CAST(DATEPART(n,Schedule.StartDate)AS VARCHAR(2))
ELSE ':' + CAST(DATEPART(n,Schedule.StartDate)AS VARCHAR(2))
END
+ ']' [NewName]
FROM
msdb.dbo.sysjobs
JOIN
dbo.ReportSchedule
ON sysjobs.name = CAST(ReportSchedule.ScheduleID AS VARCHAR(255))
JOIN
dbo.Schedule
ON ReportSchedule.ScheduleID = Schedule.ScheduleID
JOIN
dbo.Catalog
ON ReportSchedule.ReportID = Catalog.ItemID
ORDER BY
Catalog.name
USE ReportServer
SELECT
CatalogParent.Name ParentName,
Catalog.Name ReportName,
ReportCreatedByUsers.UserName ReportCreatedByUserName,
Catalog.CreationDate ReportCreationDate,
ReportModifiedByUsers.UserName ReportModifiedByUserName,
Catalog.ModifiedDate ReportModifiedDate,
CountExecution.CountStart TotalExecutions,
ExecutionLog.InstanceName LastExecutedInstanceName,
ExecutionLog.UserName LastExecutedUserName,
ExecutionLog.Format LastExecutedFormat,
ExecutionLog.TimeStart LastExecutedTimeStart,
ExecutionLog.TimeEnd LastExecutedTimeEnd,
ExecutionLog.TimeDataRetrieval LastExecutedTimeDataRetrieval,
ExecutionLog.TimeProcessing LastExecutedTimeProcessing,
ExecutionLog.TimeRendering LastExecutedTimeRendering,
ExecutionLog.Status LastExecutedStatus,
ExecutionLog.ByteCount LastExecutedByteCount,
ExecutionLog.[RowCount] LastExecutedRowCount,
SubscriptionOwner.UserName SubscriptionOwnerUserName,
SubscriptionModifiedByUsers.UserName SubscriptionModifiedByUserName,
Subscriptions.ModifiedDate SubscriptionModifiedDate,
Subscriptions.Description SubscriptionDescription,
Subscriptions.LastStatus SubscriptionLastStatus,
Subscriptions.LastRunTime SubscriptionLastRunTime
FROM
dbo.Catalog
JOIN
dbo.Catalog CatalogParent
ON Catalog.ParentID = CatalogParent.ItemID
JOIN
dbo.Users ReportCreatedByUsers
ON Catalog.CreatedByID = ReportCreatedByUsers.UserID
JOIN
dbo.Users ReportModifiedByUsers
ON Catalog.ModifiedByID = ReportModifiedByUsers.UserID
LEFT JOIN
(
SELECT
ReportID,
MAX(TimeStart) LastTimeStart
FROM
dbo.ExecutionLog
GROUP BY
ReportID
) LatestExecution
ON Catalog.ItemID = LatestExecution.ReportID
LEFT JOIN
(
SELECT
ReportID,
COUNT(TimeStart) CountStart
FROM
dbo.ExecutionLog
GROUP BY
ReportID
) CountExecution
ON Catalog.ItemID = CountExecution.ReportID
LEFT JOIN
dbo.ExecutionLog
ON LatestExecution.ReportID = ExecutionLog.ReportID
AND LatestExecution.LastTimeStart = ExecutionLog.TimeStart
LEFT JOIN
dbo.Subscriptions
ON Catalog.ItemID = Subscriptions.Report_OID
LEFT JOIN
dbo.Users SubscriptionOwner
ON Subscriptions.OwnerID = SubscriptionOwner.UserID
LEFT JOIN
dbo.Users SubscriptionModifiedByUsers
ON Subscriptions.ModifiedByID = SubscriptionModifiedByUsers.UserID
ORDER BY
CatalogParent.Name,
Catalog.Name