<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>System Center &#8211; XtremeOwnage</title>
	<atom:link href="https://xtremeownage.com/category/technology/system-center/feed/" rel="self" type="application/rss+xml" />
	<link>https://xtremeownage.com</link>
	<description>Cars, Computers, and Code.</description>
	<lastBuildDate>Sun, 08 Jan 2023 02:09:07 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.4.3</generator>

<image>
	<url>https://xtremeownage.com/wp-content/uploads/2019/09/cropped-Turbo-512-2-100x100.png</url>
	<title>System Center &#8211; XtremeOwnage</title>
	<link>https://xtremeownage.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>SCOM &#8211; Locate Computers in Maintenance</title>
		<link>https://xtremeownage.com/2019/10/01/scom-locate-computers-in-maintenance/</link>
		
		<dc:creator><![CDATA[XO]]></dc:creator>
		<pubDate>Tue, 01 Oct 2019 16:46:03 +0000</pubDate>
				<category><![CDATA[System Center Operations Manager]]></category>
		<guid isPermaLink="false">https://xtremeownage.com/?p=431</guid>

					<description><![CDATA[A simple powershell function to quickly find out which objects are in maintenance mode, and who placed the object into maintenance mode.]]></description>
										<content:encoded><![CDATA[
<p>I ran into an issue today where a important production server was not being monitored. As well- when the user placed the object into maintenance mode, they did not include comments. Lastly- the UI does not show who performed the action by default without digging.</p>



<p>So- today, I present to you, a simple powershell function to find all Windows Computers in maintenance mode, and to output a table showing the computer&#8217;s name, who placed it into maintenance mode, the start and end time, and comments if available.</p>



<p>Here is the simple script:</p>



<pre title="Get-ObjectsInMaintenanceMode Function" class="wp-block-code"><code lang="powershell" class="language-powershell line-numbers">function Get-ObjectsInMaintenance
{
    Param(
        [Parameter(Mandatory=$false)][string[]]$excludeFromAccount = $null,
        [Parameter(Mandatory=$false)][string]$ManagementPackClass = "Microsoft.Windows.Computer"
    )
    
    $class = Get-SCOMClass -Name $ManagementPackClass
    $ComputersInMaintenance = Get-SCOMClassInstance -Class $class | Where InMaintenanceMode -eq $true
    ForEach($com in $ComputersInMaintenance)
    {
        $mm = $com | Get-SCOMMaintenanceMode

        #If there are values in excludeFromAccount, match the values against the User field.
        if($excludeFromAccount -ne $null -and $excludeFromAccount -contains $mm.User)
        {
            continue
        }

        
        [pscustomobject]@{
            Name = $com.Name
            Who = $mm.User
            StartTime = $mm.StartTime
            EndTime = $mm.ScheduledEndTime
            Comments = $mm.Comments
        } | Write-Output
    }
}

#Connect to your management group
New-SCOMManagementGroupConnection scom.mydomain.com

#Example 1. Show all Windows Computers in Maintenance Mode.
Get-ObjectsInMaintenance | Format-Table

##Example 2. Show all Windows Computers in Maintenance Mode, EXCEPT, if my account performed the action.
Get-ObjectsInMaintenance -excludeFromAccount 'MyDomain\AccountToExclude1' | Format-Table

##Example 3. Show all Windows Computers in Maintenance Mode, EXCEPT, by multiple accounts
Get-ObjectsInMaintenance -excludeFromAccount 'MyDomain\AccountToExclude1','MyDomain\AccountToExclude2' | Format-Table

#Example 4. Show all Unix objects in Maintenance Mode
Get-ObjectsInMaintenance -ManagementPackClass "Microsoft.Unix.Computer" | Format-Table</code></pre>



<p>For the above script, it is capable of filtering out any number of potential accounts, which is handy if you don&#8217;t want to audit yourself, or a trusted service-account.</p>



<p>As well- while it defaults to microsoft.windows.computer, you can specify any separate management pack class to view.</p>



<p>Lastly- the above script does not include any error handling to validate you provided a valid class, or you have a valid connection&#8230; etc. Just sharing my simple cmdlet for anybody who may benefit from it.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Collection Membership based on Folder Existing</title>
		<link>https://xtremeownage.com/2015/02/03/collection-membership-based-on-folder-existing/</link>
		
		<dc:creator><![CDATA[XO]]></dc:creator>
		<pubDate>Tue, 03 Feb 2015 21:33:19 +0000</pubDate>
				<category><![CDATA[System Center Configuration Manager]]></category>
		<guid isPermaLink="false">https://xtremeownage.com/?p=461</guid>

					<description><![CDATA[Here is an old example I created back in 2015, to populate a collection based on devices who have a folder present. As apart of the migration to this new...]]></description>
										<content:encoded><![CDATA[
<p>Here is an old example I created back in 2015, to populate a collection based on devices who have a folder present. As apart of the migration to this new blog- it has been reposted here.</p>



<p>

Ever had the need to create a SCCM collection based on if a folder exists on a system?</p>



<p>Well, its quite easy.</p>



<p>Under Criteria, Select Software Files.<br>Select your Value as File Path</p>



<p>Remember to use your wildcard! &#8220;%&#8221;</p>



<p>The end query will resemble this: </p>



<pre class="wp-block-code"><code lang="sql" class="language-sql line-numbers">select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client 
FROM SMS_R_System inner join SMS_G_System_SoftwareFile on SMS_G_System_SoftwareFile.ResourceId = SMS_R_System.ResourceId 
WHERE SMS_G_System_SoftwareFile.FilePath LIKE "C:\\Temp\\%"</code></pre>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
