I can’t wait to get ConfigMgr 2012 up and running. Beta 2 is going into my lab as i type…
Until then…. Yes, ConfigMgr 2007 is fantastic, i love it. But i deploy it at customer sites and as a rule the technicals who are to run and operate it once i have gone have not taken any form of SCCM training. With 2007’s MMC Console it can be a bit daunting for them, so much information, and the access security is not what it should be. So until the launch of 2012 with it’s lovely interfaces and user-friendly-centric operations how can i enable my customers to carry out day-to-day tasks in SCCM?
First of all identify the key stakeholders: Who wants SCCM? Who needs SCCM? Why do they want it? What role in the business do they expect it perform?
FD: Paying for this new technology, wants return on investment.
IT Manager or similar: Probably wants deployment processes streamlined for their staff, to enable them to work more efficiently. Wants to know what IT equipment and licensing they have. Doesn’t care about the technical side.
IT Technician: More interested in the technical aspects. May want to get under the hood, but without training not advisable. Has (hopefully) documented the deployment and operational processes they want to streamline. Knows the applications, the estate, the environment.
For FDs and IT Management, the built-in Reports may well be enough to get information on the estate and inventory, with R2’s Reporting Services Point enhancing this functionality.
For Technicians, those who will be running and maintaining the SCCM environment and carrying out the deployment and administrative tasks with SCCM the MMC console can be a maze of nodes and components.
I identified a need for a customer to carry out basic tasks, such as Import Computer Information. They wanted to quickly add in new hardware to receive OSD Task Sequence Advertisements via PXE. I created a simple tool in Powershell which they could run from their desktop and easily add a new laptop or computer for OS deployment.
First of all, and i won’t go into too much detail here, i set up an OSD Task Sequence, a Collection and advertised the TS.
In normal circumstances, the technician would open the SCCM console, find the collection with the TS advert and drill-down through the OSD Node, to import the computer using the wizard.
All these steps are possible with WMI.
The basic powershell to add a computer account to SCCM:
#create Computer Account in SCCM
$siteClassString=”\\$siteProviderName\root\sms\site_$siteCode”+”:SMS_Site”
$siteClass=[WmiClass]$siteClassString
$methodAddEntry=”ImportMachineEntry”
$inParamsAddEntry=$siteClass.psbase.GetMethodParameters($methodAddEntry)
$inParamsAddEntry.MACAddress =$mACAddress.Text
$inParamsAddEntry.OverwriteExistingRecord =$false
$inParamsAddEntry.NetbiosName =$serverName.Text
$objComputer=$siteClass.psbase.InvokeMethod($methodAddEntry, $inParamsAddEntry, $null)
Next add the direct collection membership rule, this always applies to the collection and not the computer:
$objCollRuleDirectString=”\\$siteProviderName\root\sms\site_$siteCode”+”:SMS_CollectionRuleDirect”
$objCollectionRuleDirect=[WmiClass]$objCollRuleDirectString
$objCollectionRuleDirect.psbase.Properties[“ResourceClassName”].Value = “SMS_R_System”
$objCollectionRuleDirect.psbase.Properties[“ResourceID”].value = $objComputer.ResourceID
$methodAddToCollection=”AddMembershipRule”
And add the computer to the collection using this rule:
$targetCollection=Get-WmiObject -ComputerName “$siteProviderName” -Namespace “root\sms\site_$siteCode” -Class “SMS_Collection” | where{$_.Name -eq $determinedCollection}
$CollectionID=$targetCollection.CollectionID
$inParamsAddToCollection=$targetCollection.psbase.GetMethodParameters($methodAddToCollection)
$inParamsAddToCollection.collectionRule=$objCollectionRuleDirect
$addToCollectionResult=$targetCollection.psbase.InvokeMethod($methodAddToCollection, $inParamsAddToCollection, $null)
I also used Computer Variables to designate if the computer is to be installed with german, french or italian regional settings and keyboard layouts, this is useful when working in Switzerland. First you create an empty array of machine variables:
#create machine task sequence variables
$machineClassString=”\\$siteProviderName\root\sms\site_$siteCode”+”:SMS_MachineSettings”
$machineClass=[WmiClass]$machineClassString
$computerInstance = $machineClass.CreateInstance()
$computerInstance.psbase.properties[“ResourceID”].value=$objComputer.ResourceID
$computerInstance.psbase.properties[“SourceSite”].value=$siteCode
$machineVariablesString=”\\$siteProviderName\root\sms\site_$siteCode”+”:SMS_MachineVariable”
for($i=0;$i-lt9;$i++)
{
$computerInstance.MachineVariables=$computerInstance.MachineVariables+[WmiClass]$machineVariablesString
}
$machineVariables=$computerInstance.MachineVariables
Then you can add variables, i use a Windows Form object to take all this information in from input:
$machineVariables[0].name=”LanguageID”
$machineVariables[0].value=$languageID.SelectedItem.ToString()
I know i have a left a lot out here, and i will skip quickly to the end, but the important thing i have found is that once you harness WMI and powershell, with windows form objects, you can create all manner of dazzling(?) tools to help make SCCM life a bit easier.
Here is a couple of screengrabs of my tool:
For client management, Roger Zander’s Client Center is still freely available from sourceforge:
http://sourceforge.net/projects/smsclictr/
And for another method to set regional settings in a task sequence, i found this post very interesting:
http://www.myitforum.com/myITToolbar/frame-click.asp?url=http://ninet.org/2010/11/osd-customising-deployment-depending-on-location/