PowerShell Script to locate SCCM objects in SCCM console

There are many object types in SCCM that supports folders in the console. Even though the object can be easily located using the search function, often we need to find out which folder does a particular object (i.e. package, advertisement, etc) reside.  At work, we use folders to separate objects for different business units and differnet IT service providers. Therefore, there are many times I need to find out where exactly is the object located. I wrote this script today called Locate-SCCMObject.PS1 Syntax: .\Locate-SCCMObject <SCCM Central Site Server> <SCCM Object ID>: Example: Using the script: From SCCM Console: The output

Continue reading

Creating a collection in SCCM for “all SCOM 2007 R2 agents without Cumulative Update 4 installed”

Recently I’ve been working on deploying a SCOM environment to monitor SCCM infrastructure. Initially we used SCCM to deploy SCOM agents out to all SCCM servers as it is our preferred method to deploy any apps. By doing so, SCOM agents are considered “Manually Installed” in SCOM, therefore I cannot simply approve updates in SCOM console and get it pushed out in SCOM. I needed to make a collection for all computers that have SCOM 2007 R2 agents installed but without CU4 so it can be used to deploy CU4 to SCOM agents. Here’s the query: Description: All computers that

Continue reading

Setting SMS_INSTALL_DIR_PATH Environment variable on SCCM site servers for SCOM SCCM management pack

According to the “Configuration Manager 2007 SP2 Management Pack User’s Guide for Operations Manager 2007 R2 and Operations Manager 2007 SP1” (for MP version 6.0.6000.2), An environment variable named “SMS_INSTALL_DIR_PATH” needs to be created on all SCCM site servers. I had to do this on 80+ site servers, so I thought why not do this using a script and let SCCM to push it out to all site servers? Therefore, I wrote a VBScript Set-EnvirVar-For-SCOM.vbs (I didn’t use PowerShell this time because it is easier to push out VBScripts via SCCM). Source Code: [sourcecode language=”vbnet”] Set objWMIService = GetObject("winmgmts:" _

Continue reading

Updated: SCCM Health Check PowerShell Script

I have updated the SCCM Health Check Script that I have originally posted here. Download Version 3.1 Here. Changes: 1. The script can now utilise Powershell Remoting to check inboxes sizes. It requires PS-Remoting to be enabled on all SCCM Site Servers. This dramatically reduced the execution time of the script in a multi-tier environment. In a production environment that I support, it reduced the execution time from 1.5 – 2 hours to around 35 minutes!  You can configure which method to use via XML file. To enable, set <PSRemoting><Value> to Enabled. Or Disabled if you want to use the

Continue reading

PowerShell Script: SCCM Health Check

30/01/2012: This script has been updated to version 3.5. Details can be found HERE. The download link on this article has also been updated to version 3.5. 26/05/2011: Version 3.3 has been posted here. The download link to the script on this post is also updated to the new version 3.3. 21/04/2011: Please be advised that I have posted a newer version of the script here. The existing script download link on this page has also been updated to point to the newer version. For the chanages in newer version, please refer to my updated post. Over the last few

Continue reading

How to locate SCCM Collection Object based on the Collection ID

Often, I found it’s hard to locate the Collection object in the SCCM console if you only know the Collection ID. Couple of weeks ago I ran into a situation where I need to modify the settings of a bunch of collection objects and all I knew was the Collection ID. I wrote a script called Get-CollectionPath that identifies all possible paths to a particular collection (as a collection can be linked to multiple places). The Syntax is: .\Get-CollectionPath <SCCM Central Site Server Name> <Collection ID> Download the script here. [sourcecode language=”powershell”] param([string]$CentralSiteServer,[string[]]$CollectionID) Function Get-CollectionName ($CollectionID) { $CollectionName = (Get-WmiObject

Continue reading

Incorrect description in SCCM Report License 03B – Computers with a specific license status (Report ID 350)

On the SCCM Report “License 03B – Computers with a specific license status” (Report ID 350, category Asset Intelligence), the description states there are 5 possible values for license status: This is incorrect. SCCM collects licensing data from client’s WMI class SoftwareLicensingProduct in root\cimv2 namespace and regarding to below MSDN article, there are 7 possible values for LicenseStatus: http://msdn.microsoft.com/en-us/library/cc534596(VS.85).aspx Below is an example of a server with license status 5 showing up in the SCCM report:

Continue reading

Get SCCM site roles using Powershell

You can run the following on the site server to find out the servers holding each SCCM role: $SMSProvider = get-wmiobject sms_providerlocation -namespace root\sms -filter “ProviderForLocalSite = True” $SiteCode = $SMSProvider.SiteCode $ProviderMachine = $SMSProvider.Machine get-wmiobject -Class SMS_SystemResourceList -NameSpace root\sms\site_$SiteCode -Computername $ProviderMachine | format-list RoleName,ServerRemoteName,SiteCode

Continue reading

Passed MCTS SCCM exam yesterday

In the last couple of weeks, I’ve been refreshing my memory on SCCM since I haven’t worked on it for almost 4 month… Yesterday, I passed Microsoft 70-401 (SCCM) exam with the score of 976/1000. Pretty disappointed that didn’t get 1000 though… Oh well, there are some SCCM work coming up at work, can’t wait to get started!

Continue reading
%d bloggers like this: