{"id":1080,"date":"2014-11-25T14:16:34","date_gmt":"2014-11-25T12:16:34","guid":{"rendered":"http:\/\/marwin.e-blog.cz\/?p=1080"},"modified":"2015-02-13T12:47:27","modified_gmt":"2015-02-13T10:47:27","slug":"ms-scom-audit-reports","status":"publish","type":"post","link":"https:\/\/svobodma.cz\/?p=1080","title":{"rendered":"MS SCOM 2007 R2 &#8211;  Audit Reports"},"content":{"rendered":"<p><a href=\"http:\/\/marwin.e-blog.cz\/?attachment_id=1081\" rel=\"attachment wp-att-1081\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-1081\" alt=\"scom2007r2\" src=\"http:\/\/marwin.e-blog.cz\/marwin.e-blog.cz\/httpdocs\/wp-content\/uploads\/scom2007r2.jpg\" width=\"145\" height=\"80\" \/><\/a><\/p>\n<p>If you need to create own audit reports in MS SQL Report Builder for MS SCOM, you need to know how do it in Report Builder. You need also know little bit about SQL \u00a0and better \u00a0to know about PL\/SQL.<\/p>\n<p>Usual target of your interest will be audit reports from AD (User logins &#8230;.). If you need to create own report for user logins, the point of your interest will be MS SQL view &#8211; <strong>AdtServer.dvAll <\/strong>located\u00a0in OperationManagerAC database.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Table join for <strong>EventID\u00a0<\/strong>on Server 2008 and newer<\/strong><\/p>\n<p>SELECT distinct<br \/>\nli.TargetDomain<br \/>\n,li.TargetUser<br \/>\n,li.PrimaryUser<br \/>\n,li.String06 GuiDID_li<br \/>\n,lo.String06 GuiDID_lo<br \/>\n,li.String01 as LogonType1<br \/>\n, li.EventMachine<br \/>\n, li.Source<br \/>\n, li.String13 as AuthPackage<br \/>\n, li.String12 as LogonProcess<br \/>\n, li.String03 as LogOnFrom<br \/>\n&#8211;, cast(CAST(li.CreationTime as time) as DATEtime) as LoginDateTime<br \/>\n&#8211;, dateadd(D,DATEDIFF(D,li.CreationTime, lo.CreationTime), cast(CAST(lo.CreationTime as time) as DATEtime)) as LogoutDateTime<br \/>\n&#8211;, CAST(li.CreationTime as time) as LoginTime<br \/>\n, li.CreationTime as LoginDate<br \/>\n, lo.CreationTime as LogoutDate<br \/>\n&#8211;, DATEDIFF(SECOND,li.CreationTime, lo.CreationTime) as diff<br \/>\n,li.String02 as LogonType2<\/p>\n<p><strong>FROM<\/strong><br \/>\n<strong> (SELECT * FROM AdtServer.dvAll WHERE EventId = 4624) AS li LEFT OUTER JOIN<\/strong><br \/>\n<strong> (SELECT * FROM AdtServer.dvAll WHERE EventId = 4634) AS lo <\/strong><br \/>\n<strong> on li.String01 = lo.String01<\/strong><\/p>\n<p>WHERE li.EventId = 4624<br \/>\nand li.CreationTime &gt; dateadd(DAY,-3,GETDATE())<br \/>\nand DATEDIFF(SECOND,li.CreationTime, lo.CreationTime) &gt; 0<br \/>\nand li.TargetUser not like &#8218;%$&#8216;<br \/>\n&#8211;and li.TargetUser = lo.TargetUser<br \/>\n&#8211;and li.String13 not like &#8218;MICROSOFT_AUTHENTICATION_PACKAGE_V1_0&#8216;<br \/>\nand li.String06 not in (&#8218;{00000000-0000-0000-0000-000000000000}&#8216;)<br \/>\n&#8211;and li.String02 in (&#8218;2&#8242;,&#8217;10&#8216;)<br \/>\nand li.String02 in (&#8218;2&#8242;,&#8217;10&#8216;)<br \/>\nand li.TargetUser not like &#8218;\/_%&#8216; escape &#8218;\/&#8216;<br \/>\nand li.TargetUser = &#8218;user&#8216;<br \/>\n&#8211;and li.EventMachine = &#8218;dc2008&#8216;<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/marwin.e-blog.cz\/?attachment_id=1130\" rel=\"attachment wp-att-1130\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-1130\" alt=\"SCOMMSSQLREPORT2008\" src=\"http:\/\/marwin.e-blog.cz\/marwin.e-blog.cz\/httpdocs\/wp-content\/uploads\/SCOMMSSQLREPORT20081.jpg\" width=\"941\" height=\"194\" \/><\/a><\/p>\n<p><strong>This description of strings could you little help, if your ACS agent are running on Windows Server 2008 and newer.:<\/strong><\/p>\n<p>, String01 as TargetLogonId<br \/>\n, String02 as LogonType<br \/>\n, String03 as LogOnFrom<br \/>\n, String04 as ipPort<br \/>\n, String05 as TargetServerNetBiosName<br \/>\n, String06 as LogonGuid<br \/>\n, String07 as String07<br \/>\n, String08 as String08<br \/>\n, String09 as\u00a0KeyLength<br \/>\n, String10 as Process_ID<br \/>\n, String11 as ProcessName<br \/>\n, String12 as LogonProcess<br \/>\n, String13 as AuthPackage<br \/>\n, String14 as String14<br \/>\n, String15 as String15<br \/>\n, String16 as String16<br \/>\n, String17 as String17<br \/>\n, String18 as String18<br \/>\n, String19 as String19<br \/>\n, String20 as String20<br \/>\n, String21 as String21<br \/>\n, String22 as String22<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>, String14 as String14<br \/>\n, String15 as String15<br \/>\n, String16 as String16<br \/>\n, String17 as String17<br \/>\n, String18 as String18<br \/>\n, String19 as String19<br \/>\n, String20 as String20<br \/>\n, String21 as String21<br \/>\n, String22 as String22<\/p>\n<p>= \u00a0is default \u00a0-&gt; n\/a<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Table join for EventID on Server 2003<\/strong><\/p>\n<p>SELECT distinct<br \/>\n, li.TargetDomain<br \/>\n, li.PrimaryUser<br \/>\n, li.EventMachine<br \/>\n, li.Source<br \/>\n, li.String09 as AuthPackage<br \/>\n, li.String02 as LogOnFrom<br \/>\n, cast(CAST(li.CreationTime as time) as DATEtime) as LoginDateTime<br \/>\n, dateadd(D,DATEDIFF(D,li.CreationTime, lo.CreationTime), cast(CAST(lo.CreationTime as time) as DATEtime)) as LogoutDateTime<br \/>\n, CAST(li.CreationTime as time) as LoginTime<br \/>\n, li.CreationTime as LoginDate<br \/>\n, lo.CreationTime as LogoutDate<br \/>\n, DATEDIFF(SECOND,li.CreationTime, lo.CreationTime) as diff<br \/>\n,li.String01 as LogonType<\/p>\n<p><strong>FROM <\/strong><br \/>\n<strong> (SELECT * FROM AdtServer.dvAll WHERE EventId = 528) AS li LEFT OUTER JOIN<\/strong><br \/>\n<strong> (SELECT * FROM AdtServer.dvAll WHERE EventId = 538) AS lo ON<\/strong><br \/>\n<strong> li.PrimaryLogonId = lo.ClientLogonId<\/strong><\/p>\n<p>where<br \/>\nli.String01 in (&#8217;10&#8216;,&#8217;2&#8242;)<br \/>\nand li.CreationTime &gt; dateadd(DAY,-6,GETDATE())<br \/>\nand DATEDIFF(SECOND,li.CreationTime, lo.CreationTime) &gt; 0<br \/>\nand li.PrimaryUser not like &#8218;%$&#8216;<br \/>\n&#8211;and li.PrimaryUser = lo.PrimaryUser<br \/>\n&#8211;and li.CreationTime &gt; &#8218;12.12.2014&#8216;<br \/>\n&#8211;and li.String13 not like &#8218;MICROSOFT_AUTHENTICATION_PACKAGE_V1_0&#8216;<br \/>\nand li.String02 in (&#8218;2&#8242;,&#8217;10&#8216;)<br \/>\nand li.PrimaryUser not like &#8218;\/_%&#8216; escape &#8218;\/&#8216;<br \/>\nand li.PrimaryUser = &#8218;username&#8216;<\/p>\n<p><a href=\"http:\/\/marwin.e-blog.cz\/?attachment_id=1133\" rel=\"attachment wp-att-1133\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-1133\" alt=\"SCOMMSSQLREPORT\" src=\"http:\/\/marwin.e-blog.cz\/marwin.e-blog.cz\/httpdocs\/wp-content\/uploads\/SCOMMSSQLREPORT1.jpg\" width=\"1035\" height=\"170\" \/><\/a><\/p>\n<p><strong>This description of Strings could you little help, if your agent are running on Windows Server 2003 and older:<\/strong><\/p>\n<p>, String01 as LogonType<br \/>\n, String02 as\u00a0LogOnFrom<br \/>\n, String03 as\u00a0String03<br \/>\n, String04 as\u00a0TargetServerNetBiosName \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 , String05 as\u00a0LogonGuid \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 , String06 as CallerProcessID<\/p>\n<p>, String07 as &#8211;<br \/>\n, String08 as\u00a0LogonProcess<br \/>\n, String09 as\u00a0AuthPackage<\/p>\n<p>, String10 as String10<br \/>\n, String11 as String11<br \/>\n, String12 as String12<br \/>\n, String13 as String13<br \/>\n, String14 as String14<br \/>\n, String15 as String15<br \/>\n, String16 as String16<br \/>\n, String17 as String17<br \/>\n, String18 as String18<br \/>\n, String19 as String19<br \/>\n, String20 as String20<br \/>\n, String21 as String21<br \/>\n, String22 as String22<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you need to create own audit reports in MS SQL Report Builder for MS SCOM, you need to know how do it in Report Builder. You need also know little bit about SQL \u00a0and better \u00a0to know about PL\/SQL. &hellip; <a href=\"https:\/\/svobodma.cz\/?p=1080\">Cel\u00fd p\u0159\u00edsp\u011bvek <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-1080","post","type-post","status-publish","format-standard","hentry","category-system-center"],"_links":{"self":[{"href":"https:\/\/svobodma.cz\/index.php?rest_route=\/wp\/v2\/posts\/1080","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/svobodma.cz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/svobodma.cz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/svobodma.cz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/svobodma.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1080"}],"version-history":[{"count":14,"href":"https:\/\/svobodma.cz\/index.php?rest_route=\/wp\/v2\/posts\/1080\/revisions"}],"predecessor-version":[{"id":1083,"href":"https:\/\/svobodma.cz\/index.php?rest_route=\/wp\/v2\/posts\/1080\/revisions\/1083"}],"wp:attachment":[{"href":"https:\/\/svobodma.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1080"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/svobodma.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1080"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/svobodma.cz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1080"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}