<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Where is user security and scheduled refresh data stored in the report server database? in Report Server</title>
    <link>https://community.fabric.microsoft.com/t5/Report-Server/Where-is-user-security-and-scheduled-refresh-data-stored-in-the/m-p/534530#M8262</link>
    <description>&lt;P&gt;This would help you out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;SELECT
	e.name AS ReportName
	,e.path AS ReportPath
	,d.description as SubscriptionName
	, a.SubscriptionID
	, d.laststatus
	, d.eventtype
	, d.LastRunTime
	,j.date_created AS ScheduleCreatedDate
	,j.date_modified AS ScheduleModifiedDate


	,CASE j.[enabled]
		WHEN 1 THEN 'Yes'
		WHEN 0 THEN 'No'
	END AS Job_Enabled
	,CASE sch.[enabled]
		WHEN 1 THEN 'Yes'
		WHEN 0 THEN 'No'
	END AS Schedule_enabled,

	CASE sch.freq_type
		WHEN 1 THEN 'Once'
		WHEN 4 THEN 'Daily'
		WHEN 8 THEN 'Weekly'
		WHEN 16 THEN 'Monthly'
		WHEN 32 THEN 'Monthly relative'
		WHEN 64 THEN 'When SQLServer Agent starts'
	END AS Frequency, 
	CASE sch.active_start_date
		WHEN 0 THEN null
		ELSE
		substring(convert(varchar(15),sch.active_start_date),1,4) + '-' + 
		substring(convert(varchar(15),sch.active_start_date),5,2) + '-' + 
		substring(convert(varchar(15),sch.active_start_date),7,2)
	END AS ScheduleStartDate,
	CASE len(sch.active_start_time)
		WHEN 3 THEN cast('00:0' 
				+ Left(right(sch.active_start_time,3),1)  
				+':' + right(sch.active_start_time,2) as char (8))
		WHEN 4 THEN cast('00:' 
				+ Left(right(sch.active_start_time,4),2)  
				+':' + right(sch.active_start_time,2) as char (8))
		WHEN 5 THEN cast('0' 
				+ Left(right(sch.active_start_time,5),1) 
				+':' + Left(right(sch.active_start_time,4),2)  
				+':' + right(sch.active_start_time,2) as char (8))
		WHEN 6 THEN cast(Left(right(sch.active_start_time,6),2) 
				+':' + Left(right(sch.active_start_time,4),2)  
				+':' + right(sch.active_start_time,2) as char (8))
	END AS ScheduleStartTime

	
	,CASE jsch.next_run_date
		WHEN 0 THEN null
		ELSE
		substring(convert(varchar(15),jsch.next_run_date),1,4) + '-' + 
		substring(convert(varchar(15),jsch.next_run_date),5,2) + '-' + 
		substring(convert(varchar(15),jsch.next_run_date),7,2)
	END AS nextRunDate,
	CASE len(jsch.next_run_time)
		WHEN 3 THEN cast('00:0' 
				+ Left(right(jsch.next_run_time,3),1)  
				+':' + right(jsch.next_run_time,2) as char (8))
		WHEN 4 THEN cast('00:' 
				+ Left(right(jsch.next_run_time,4),2)  
				+':' + right(jsch.next_run_time,2) as char (8))
		WHEN 5 THEN cast('0' 
				+ Left(right(jsch.next_run_time,5),1) 
				+':' + Left(right(jsch.next_run_time,4),2)  
				+':' + right(jsch.next_run_time,2) as char (8))
		WHEN 6 THEN cast(Left(right(jsch.next_run_time,6),2) 
				+':' + Left(right(jsch.next_run_time,4),2)  
				+':' + right(jsch.next_run_time,2) as char (8))
	END AS NextRunTime
FROM ReportServer.dbo.ReportSchedule a 
        LEFT OUTER JOIN ReportServer.dbo.ReportSchedule c
            ON a.ScheduleID = c.ScheduleID
        LEFT OUTER JOIN ReportServer.dbo.Subscriptions d
            ON c.SubscriptionID = d.SubscriptionID
        LEFT OUTER JOIN ReportServer.dbo.[Catalog] e
            ON d.report_oid = e.itemid
		LEFT OUTER JOIN msdb.dbo.sysjobs j
			ON CAST(a.ScheduleID AS VARCHAR(100)) = j.name
		LEFT OUTER JOIN msdb.dbo.sysjobschedules jsch
			ON j.job_id = jsch.job_id
		LEFT OUTER JOIN msdb.dbo.sysschedules sch
			ON sch.schedule_id = jsch.schedule_id&lt;BR /&gt;
-- to find specific report last status 
-- WHERE e.name = 'Usage Stats'&lt;BR /&gt;
-- to find failed status
--WHERE 
--		LastStatus &amp;lt;&amp;gt; 'Completed Data Refresh'&lt;BR /&gt;
-- or for a specific SQL Agent Job
--WHERE &lt;BR /&gt;--b.name = '9B7BED26-A81C-479C-A23B-016C9E05E760'
-- NOTE you have to look in subscription history for any error messages/details and decode the JSON response (good luck with that!)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Check the below blog as well.&lt;/P&gt;&lt;P&gt;&lt;A href="https://workingondata.wordpress.com/2017/11/02/walkthrough-scheduled-data-refresh-in-power-bi-report-server/&amp;nbsp;" target="_blank"&gt;https://workingondata.wordpress.com/2017/11/02/walkthrough-scheduled-data-refresh-in-power-bi-report-server/&amp;nbsp;&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 05 Oct 2018 09:07:01 GMT</pubDate>
    <dc:creator>BhaveshPatel</dc:creator>
    <dc:date>2018-10-05T09:07:01Z</dc:date>
    <item>
      <title>Where is user security and scheduled refresh data stored in the report server database?</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Where-is-user-security-and-scheduled-refresh-data-stored-in-the/m-p/533976#M8254</link>
      <description>&lt;P&gt;Would like to create a report to show when all the reports on our Report server are scheduled to refresh.&amp;nbsp; If this is possible where is the information stored.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also would like to report on what AD group the user belongs to is that stored anywhere on the Report server?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 19:49:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Where-is-user-security-and-scheduled-refresh-data-stored-in-the/m-p/533976#M8254</guid>
      <dc:creator>4Eric</dc:creator>
      <dc:date>2018-10-04T19:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: Where is user security and scheduled refresh data stored in the report server database?</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Where-is-user-security-and-scheduled-refresh-data-stored-in-the/m-p/534530#M8262</link>
      <description>&lt;P&gt;This would help you out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;SELECT
	e.name AS ReportName
	,e.path AS ReportPath
	,d.description as SubscriptionName
	, a.SubscriptionID
	, d.laststatus
	, d.eventtype
	, d.LastRunTime
	,j.date_created AS ScheduleCreatedDate
	,j.date_modified AS ScheduleModifiedDate


	,CASE j.[enabled]
		WHEN 1 THEN 'Yes'
		WHEN 0 THEN 'No'
	END AS Job_Enabled
	,CASE sch.[enabled]
		WHEN 1 THEN 'Yes'
		WHEN 0 THEN 'No'
	END AS Schedule_enabled,

	CASE sch.freq_type
		WHEN 1 THEN 'Once'
		WHEN 4 THEN 'Daily'
		WHEN 8 THEN 'Weekly'
		WHEN 16 THEN 'Monthly'
		WHEN 32 THEN 'Monthly relative'
		WHEN 64 THEN 'When SQLServer Agent starts'
	END AS Frequency, 
	CASE sch.active_start_date
		WHEN 0 THEN null
		ELSE
		substring(convert(varchar(15),sch.active_start_date),1,4) + '-' + 
		substring(convert(varchar(15),sch.active_start_date),5,2) + '-' + 
		substring(convert(varchar(15),sch.active_start_date),7,2)
	END AS ScheduleStartDate,
	CASE len(sch.active_start_time)
		WHEN 3 THEN cast('00:0' 
				+ Left(right(sch.active_start_time,3),1)  
				+':' + right(sch.active_start_time,2) as char (8))
		WHEN 4 THEN cast('00:' 
				+ Left(right(sch.active_start_time,4),2)  
				+':' + right(sch.active_start_time,2) as char (8))
		WHEN 5 THEN cast('0' 
				+ Left(right(sch.active_start_time,5),1) 
				+':' + Left(right(sch.active_start_time,4),2)  
				+':' + right(sch.active_start_time,2) as char (8))
		WHEN 6 THEN cast(Left(right(sch.active_start_time,6),2) 
				+':' + Left(right(sch.active_start_time,4),2)  
				+':' + right(sch.active_start_time,2) as char (8))
	END AS ScheduleStartTime

	
	,CASE jsch.next_run_date
		WHEN 0 THEN null
		ELSE
		substring(convert(varchar(15),jsch.next_run_date),1,4) + '-' + 
		substring(convert(varchar(15),jsch.next_run_date),5,2) + '-' + 
		substring(convert(varchar(15),jsch.next_run_date),7,2)
	END AS nextRunDate,
	CASE len(jsch.next_run_time)
		WHEN 3 THEN cast('00:0' 
				+ Left(right(jsch.next_run_time,3),1)  
				+':' + right(jsch.next_run_time,2) as char (8))
		WHEN 4 THEN cast('00:' 
				+ Left(right(jsch.next_run_time,4),2)  
				+':' + right(jsch.next_run_time,2) as char (8))
		WHEN 5 THEN cast('0' 
				+ Left(right(jsch.next_run_time,5),1) 
				+':' + Left(right(jsch.next_run_time,4),2)  
				+':' + right(jsch.next_run_time,2) as char (8))
		WHEN 6 THEN cast(Left(right(jsch.next_run_time,6),2) 
				+':' + Left(right(jsch.next_run_time,4),2)  
				+':' + right(jsch.next_run_time,2) as char (8))
	END AS NextRunTime
FROM ReportServer.dbo.ReportSchedule a 
        LEFT OUTER JOIN ReportServer.dbo.ReportSchedule c
            ON a.ScheduleID = c.ScheduleID
        LEFT OUTER JOIN ReportServer.dbo.Subscriptions d
            ON c.SubscriptionID = d.SubscriptionID
        LEFT OUTER JOIN ReportServer.dbo.[Catalog] e
            ON d.report_oid = e.itemid
		LEFT OUTER JOIN msdb.dbo.sysjobs j
			ON CAST(a.ScheduleID AS VARCHAR(100)) = j.name
		LEFT OUTER JOIN msdb.dbo.sysjobschedules jsch
			ON j.job_id = jsch.job_id
		LEFT OUTER JOIN msdb.dbo.sysschedules sch
			ON sch.schedule_id = jsch.schedule_id&lt;BR /&gt;
-- to find specific report last status 
-- WHERE e.name = 'Usage Stats'&lt;BR /&gt;
-- to find failed status
--WHERE 
--		LastStatus &amp;lt;&amp;gt; 'Completed Data Refresh'&lt;BR /&gt;
-- or for a specific SQL Agent Job
--WHERE &lt;BR /&gt;--b.name = '9B7BED26-A81C-479C-A23B-016C9E05E760'
-- NOTE you have to look in subscription history for any error messages/details and decode the JSON response (good luck with that!)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Check the below blog as well.&lt;/P&gt;&lt;P&gt;&lt;A href="https://workingondata.wordpress.com/2017/11/02/walkthrough-scheduled-data-refresh-in-power-bi-report-server/&amp;nbsp;" target="_blank"&gt;https://workingondata.wordpress.com/2017/11/02/walkthrough-scheduled-data-refresh-in-power-bi-report-server/&amp;nbsp;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2018 09:07:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Where-is-user-security-and-scheduled-refresh-data-stored-in-the/m-p/534530#M8262</guid>
      <dc:creator>BhaveshPatel</dc:creator>
      <dc:date>2018-10-05T09:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: Where is user security and scheduled refresh data stored in the report server database?</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Where-is-user-security-and-scheduled-refresh-data-stored-in-the/m-p/539090#M8354</link>
      <description>&lt;P&gt;Thank you so much!&amp;nbsp; now I just have to figure out the security part.&amp;nbsp; Really all I want is what AD group they are assigned to or used to login in.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2018 21:44:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Where-is-user-security-and-scheduled-refresh-data-stored-in-the/m-p/539090#M8354</guid>
      <dc:creator>4Eric</dc:creator>
      <dc:date>2018-10-10T21:44:06Z</dc:date>
    </item>
  </channel>
</rss>

