PowerShell / ConfigMgr: Count of Client Manufacturer / Models

Introduction If you’re an administrator of Microsoft System Center Configuration Manager (SCCM / ConfigMgr) 2007, you might be interested in finding out what make / model of client & server systems you have, and how many of each unique value you have. Most people would probably simply pull up a ConfigMgr report, but did you … Read more PowerShell / ConfigMgr: Count of Client Manufacturer / Models

PowerShell: Ping Host List from Text File

Here’s a quick PowerShell script to ping a list of hosts (computers, or other IP endpoints) from a text file. In addition, it eliminates error messages, which results in a filtered list of hosts that are alive. It runs quickly, because the ping count has been restricted to 1, from the default of 4. Clear-Host … Read more PowerShell: Ping Host List from Text File

PowerShell: Update your ConfigMgr OSD Boot Images to WinPE 3.1

When you upgrade your boot images in Microsoft’s System Center Configuration Manager (SCCM / ConfigMgr) 2007 from WinPE 3.0 to WinPE 3.1, you must run the ExportDefaultBootImage() WMI method on the SMS_BootImagePackage WMI class for each boot image architecture. Typically this would simply include x86 (32-bit) and x64 (64-bit) boot images (Windows Image Format (WIM) … Read more PowerShell: Update your ConfigMgr OSD Boot Images to WinPE 3.1

PowerShell: Determine Number of Parameters on Cmdlets

In PowerShell, each “cmdlet” has input and output parameters. Cmdlet definitions (including their names, parameters, parameters sets, attributes, etc.) are rich objects, just like every other object in PowerShell. Because of this, we can easily find out which cmdlets have the most parameters. We follow this process to retrieve the information mentioned above: Retrieve a … Read more PowerShell: Determine Number of Parameters on Cmdlets

Orchestrator 2012: Value does not fall within the expected range

I was recently troubleshooting a problem with the Orchestrator 2012 Beta web service, and got the error message “Value does not fall within the expected range” when trying to start the web service IIS website from the IIS console.

image

Read moreOrchestrator 2012: Value does not fall within the expected range

Orchestrator 2012: Error During Installation

Update: I have resolved the problem by using msizap.exe (a utility included in the Windows SDK) to kill the Orchestrator Management Service from the MSI database, and then reinstalled just that component (by running microsoft.systemcenter.orchestrator.managementserver.msi)

I’ve been repeatedly having trouble installing System Center Orchestrator 2012 on a Windows Server 2008 R2 SP1 VMware guest. My installation log is below. It seems that it is having a problem starting the service named: OpalisActionService.

Read moreOrchestrator 2012: Error During Installation

PowerShell: Shortening Web Service Type Names with a Hashtable

When you use the New-WebServiceProxy class, you probably have noticed that PowerShell dynamically generates some really ugly type names. For example, if we get a reference to the Bing web service (you’ll need to get an API key first):

$BingSearch = New-WebServiceProxy -Class BingSearch -Uri "http://api.search.live.net/search.wsdl?AppID=$ApiKey"

… and examine the types contained within it:

$BingSearch.GetType().Assembly.GetExportedTypes() | select FullName

… you’ll notice some ridiculously long type names based on your API key, such as:

Microsoft.PowerShell.Commands.NewWebserviceProxy.AutogeneratedTypes.WebServiceProxyXXXXXXXXXXXXXXXXXXXXXXXXXXX.SearchRequest

Read morePowerShell: Shortening Web Service Type Names with a Hashtable

Extreme PowerShell / ConfigMgr: Extending Hardware Inventory

Introduction

In previous versions of Microsoft System Center Configuration Manager (ConfigMgr / SCCM), a common task for administrators, engineers, and consultants, was to extend the hardware inventory configuration. These inventory extensions were written in Managed Object Format (MOF) and allowed the SCCM client agents to report back a wider array of information to the central site database for reporting purposes, collection building, and other management tasks. Making changes to the configuration could be a tedious task, as MOF is not very forgiving, and rather quite strict, in its syntax.

In Microsoft Systems Management Server 2003 (SMS 2003), each time a configuration change was made, it was necessary to deploy the updated MOF file to the SMS clients — this made ensuring hardware inventory consistency across all clients a challenging task. In SCCM, Microsoft included changes to these MOF files (SMS_DEF.mof and Configuration.mof) as part of the machine policy refresh task, which is a client-side polling mechanism for configuration changes.

In SCCM 2012 Beta 2, Microsoft is taking it a step further and has eliminated the SMS_DEF.mof altogether, left the configuration.mof behind by itself, and stuck the WMI inventory configuration in … WMI. What is WMI? WMI stands for Windows Management Instrumentation, a service built into the Windows Operating System since Windows XP (and Windows 2000 Service Pack 4, I think). It provides a standard method of exposing hardware and software level system information to applications, such as storage, processor, memory, running processes, installed software, and other application configuration data. SCCM is built on top of this technology, and often makes developing software and scripts around the product much easier than it otherwise might be.

For the remainder of this article, we’re going to look at specifically how to extend hardware inventory in SCCM 2012 programmatically using Windows PowerShell with the SCCM WMI provider.

Read moreExtreme PowerShell / ConfigMgr: Extending Hardware Inventory

PowerShell: Retrieve List of SCCM Site Codes

If you’re using System Center Configuration Manager (SCCM / ConfigMgr) 2007, you may want to discover how many SCCM sites you have from Active Directory. Of course, this assumes that you have Active Directory publishing enabled on your primary sites. When enabled, SCCM automatically places site information underneath the CN=System Management,CN=System,DN=mydomain,DC=com container.

Read morePowerShell: Retrieve List of SCCM Site Codes