<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Marcelo Guterres's Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/marceloguterres/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/marceloguterres/feed.xml</link>
    <description>Posts in this blog are provided &amp;quot;AS IS&amp;quot; with no warranties, and confers no rights.</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:45:47 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Creating a Performance Rule to collect SCCM SQL Service Broker Queue</title>
      <link>https://docs.microsoft.com/archive/blogs/marceloguterres/creating-a-performance-rule-to-collect-sccm-sql-service-broker-queue</link>
      <pubDate>Wed, 06 Sep 2017 17:44:56 GMT</pubDate>
      <dc:creator><![CDATA[Marcelo Guterres]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/marceloguterres/?p=155</guid>
      <description><![CDATA[Hi everyone!

Sometimes we need get some information that SCOM don't collect for us natively. The...]]></description>
      <content:encoded><![CDATA[Hi everyone!

Sometimes we need get some information that SCOM don't collect for us natively. The SCCM Broker queue is an example.

I'll show you with few steps how to create a view like this:

<a href="https://msdnshared.blob.core.windows.net/media/2017/09/PerformanceView1.png"><img width="865" height="631" class="alignnone size-full wp-image-185" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/09/PerformanceView1.png" /></a>

&nbsp;

The first step is create a script to get all information that you need. The script below need some changes, please pay attention to change all <strong>BOLD</strong> values.

<code>Dim objCN
Dim strConnection
Dim oAPI, oBag
Set oAPI = CreateObject("MOM.ScriptAPI")
Set oBag = oAPI.CreatePropertyBag()
Set objCN = CreateObject("ADODB.Connection")
strConnection = "Driver={SQL Server};Server=<em><strong>SQLSERVERNAME\INSTANCE</strong></em>;Database=<strong>DATABASENAME</strong>;Trusted_Connection=TRUE"
objCN.Open strConnection
Dim strSQLQuery
strSQLQuery = "SELECT COUNT(*) as value FROM [dbo].[ConfigMgrDRSQueue] WITH(NOLOCK)"
Dim objRS
Set objRS=CreateObject("ADODB.Recordset")
Set objRS = objCN.Execute(strSQLQuery)
valor = objRS.Fields("value")
Call oBag.AddValue("PerfValue",CDbl(valor))
Call oAPI.Return(oBag)</code>

The second step is create a Collection Rule to get the values of each queue.

Go to <em>Authoring &gt; Management Pack Objects &gt; Rules</em>, and select the template <em>Probe Based &gt; Script (Performance)</em>, like the picture below:

<a href="https://msdnshared.blob.core.windows.net/media/2017/09/Rule01.png"><img width="766" height="652" class="alignnone size-full wp-image-195" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/09/Rule01.png" /></a>

Select the destination Management Pack and click Next.

Give a name to the Rule and choose the target the Windows Computer Class. VERY IMPORTANT: Uncheck the "<em>Rule is enable</em>".

<a href="https://msdnshared.blob.core.windows.net/media/2017/09/Rule02.png"><img width="766" height="656" class="alignnone size-full wp-image-205" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/09/Rule02.png" /></a>

Give a name to the script. Don't forget the "<em>.vbs</em>" in the end. Paste the script with all needed alterations and click Next.

<a href="https://msdnshared.blob.core.windows.net/media/2017/09/Rule03.png"><img width="765" height="657" class="alignnone size-full wp-image-215" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/09/Rule03.png" /></a>

In performance mapping information put your values but don't change the last item <em>$Data/Property[@Name='PerfValue']$. </em>Save the Rule.

<a href="https://msdnshared.blob.core.windows.net/media/2017/09/Rule04.png"><img width="518" height="286" class="alignnone size-full wp-image-216" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/09/Rule04.png" /></a>

The third step is create a Override to enable the Rule to the Windows Computer of the SQL Server that have the SCCM Broker.

The last step is create a Performance View and select all Rule that you have created with the steps above.

<a href="https://msdnshared.blob.core.windows.net/media/2017/09/PerformanceView1.png"><img width="865" height="631" class="alignnone size-full wp-image-185" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/09/PerformanceView1.png" /></a>

Enjoy!!!

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>Enabling ACS Forwarder by filter</title>
      <link>https://docs.microsoft.com/archive/blogs/marceloguterres/enabling-acs-forwarder-by-filter</link>
      <pubDate>Wed, 20 Apr 2016 10:01:02 GMT</pubDate>
      <dc:creator><![CDATA[Marcelo Guterres]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/marceloguterres/?p=45</guid>
      <description><![CDATA[On Large environments it's very common use Audit Collection Service. With the powershell script...]]></description>
      <content:encoded><![CDATA[On Large environments it's very common use Audit Collection Service. With the powershell script below, it's possible enable ACS Forwarder automatically.
This is the "Monitoring" workspace on SCOM Console showing ACS Views:<code>
<img class="alignnone  wp-image-85" src="https://msdnshared.blob.core.windows.net/media/2016/04/ACS-Filter-01-300x263.jpg" alt="ACS Filter 01" width="247" height="216" /></code>

The Collector Server in my lab:
<a href="https://msdnshared.blob.core.windows.net/media/2016/04/ACS-Filter-02.jpg"><img class="alignnone  wp-image-95" src="https://msdnshared.blob.core.windows.net/media/2016/04/ACS-Filter-02-300x44.jpg" alt="ACS Filter 02" width="389" height="57" /></a>

My Forwarders. I don't have any at the moment:
<a href="https://msdnshared.blob.core.windows.net/media/2016/04/ACS-Filter-03.jpg"><img class="alignnone size-medium wp-image-105" src="https://msdnshared.blob.core.windows.net/media/2016/04/ACS-Filter-03-300x127.jpg" alt="ACS Filter 03" width="300" height="127" /></a>

The script below has two parameters for change: "$collectorName = '<em>Name of your Collect Server</em>' " and "($Object -like '*String for filter the servers*')"
<a href="https://msdnshared.blob.core.windows.net/media/2016/04/ACS-Filter-04.jpg"><img class="alignnone size-medium wp-image-115" src="https://msdnshared.blob.core.windows.net/media/2016/04/ACS-Filter-04-300x100.jpg" alt="ACS Filter 04" width="300" height="100" /></a>

Below you can see the script code. It's a very simple script:

<code>$collectorName = 'LAB-SCOM02.mgs.lab'
$override = new-object Hashtable
$override.Add('CollectorServer',$collectorName)
$healthServices = Get-SCOMClass -Name 'Microsoft.SystemCenter.HealthService'| Get-SCOMMonitoringObject
$EnableAcsTask = Get-SCOMTask | Where {$_.Name -eq 'Microsoft.SystemCenter.EnableAuditCollectionService'}
write-host $EnableAcsTask
foreach($Object in $healthServices){
if ($Object -like '*SQL*'){
write-host $Object
Start-SCOMTask -Task $EnableAcsTask -Instance $Object -Override $override
}
}</code>

I execute using the filter "SQL" for enable ACS Forwarder at any server with the string "SQL" at the name:
<a href="https://msdnshared.blob.core.windows.net/media/2016/04/ACS-Filter-05.jpg"><img class="alignnone size-medium wp-image-125" src="https://msdnshared.blob.core.windows.net/media/2016/04/ACS-Filter-05-300x180.jpg" alt="ACS Filter 05" width="300" height="180" /></a>

Now I can see at the "Forwarder State View" the server LAB-SQL01:
<a href="https://msdnshared.blob.core.windows.net/media/2016/04/ACS-Filter-06.jpg"><img class="alignnone size-medium wp-image-135" src="https://msdnshared.blob.core.windows.net/media/2016/04/ACS-Filter-06-300x123.jpg" alt="ACS Filter 06" width="300" height="123" /></a>

I create this script for using like an example when you have a lot of servers for enable ACS Forwarder. It's possible increase the script for enable automatically using many strings for filter and running with a Schedule Task.]]></content:encoded>
    </item>
    <item>
      <title>A simple way to test a lot of SCCM distribution point availability with System Center Operations Manager</title>
      <link>https://docs.microsoft.com/archive/blogs/marceloguterres/a-simple-way-to-test-a-lot-of-sccm-distribution-point-availability-with-system-center-operations-manager</link>
      <pubDate>Mon, 18 Apr 2016 23:39:31 GMT</pubDate>
      <dc:creator><![CDATA[Marcelo Guterres]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/marceloguterres/?p=25</guid>
      <description><![CDATA[Hi everyone!

This is a simple way to monitor a URL of a SCCM Distribution Point. I have some...]]></description>
      <content:encoded><![CDATA[Hi everyone!

This is a simple way to monitor a URL of a SCCM Distribution Point. I have some customers with a necessity of a visualization about Distribution Point health. The customer has a lot of Distribution Points and a big problem with authentication for remote url tests. So, is not my first option create a "Web Application Availability Monitoring" for each "URL" for each "Distribution Point" (the customer has a thousands distribution points).
The simple way for this object is test the URL locally. How is this possible? I created a monitor with the script below:
Script VBS:
<code>Option Explicit
Dim objWinHttp
Dim strCheckURL
Dim oAPI
Dim oBag
Set oAPI = CreateObject("MOM.ScriptAPI")
Set oBag = oAPI.CreatePropertyBag()
strCheckURL = "<a href="https://localhost/sms_dp_smspkg$/cas00002">https://localhost/sms_dp_smspkg$/cas00001</a>"
Set objWinHttp = CreateObject("WinHttp.WinHttpRequest.5.1")
objWinHttp.SetTimeouts 29000, 29000, 29000, 29000
objWinHttp.Open "GET", strCheckURL
On Error Resume Next
objWinHttp.Send()
If Err.number = 0 Then
If (objWinHttp.Status = 200) Then
Call oBag.AddValue ("Status","OK")
End If
else
If (objWinHttp.Status &lt;&gt; 200) Then
Call oBag.AddValue ("Status","Error")
End If
End If
Set objWinHttp = Nothing
oAPI.Return(oBag)</code>

The URL showed above change on each SCCM environment because the name of the SCCM Client package. I created an override for the monitor pointing to the "ConfigMgr Distribution Point" class. With this target all new Distribution Point with the Operations Manager Client will be automatically monitored.

It's simple but very useful!]]></content:encoded>
    </item>
  </channel>
</rss>