SCAPaoT

System Center, Automation, Powershell and other Thoughts

Tag Archives

(Update) SCCM vNext and Powershell

A few weeks ago,
(http://www.scapaot.de/blog/?p=57),
I have written about the question if there will be Powershell support in SCCM vNext.

On yesterday I had the chance to listen to a very interesting talk from Microsoft about the user centric software deployment and SCCM vNext.
There I had the chance to ask about the Powershell support in the next version.

The answer is:

The next version has support for the same WMI classes
as it has in SCCM 07.
And there will be new WMI classes for the new features.
Powershell support is there using WMI cmdlets.

And perhaps the SDK for vNext will have some little more infos about using the Powershell to manage SCCM.
Cmdlets are not planed at the moment.

So, for all of you want to learn how to automate SCCM,
go out and learn something about WMI.

Do you know Opalis?

In December 2009 Microsoft bought the leader in datacenter automation and his famous product “Opalis Integration Server”.

Using Opalis you can fully automate provisioning in your datacenters. For example, building up a Virtual Server without any interaction in just a few minutes or adding a new user to all your systems with just a single click.
All of these tasks are done using a little process. The processes are build using drag and drop.

Microsoft has now released a roadmap of the integration of Opalis into its System Center products.  Opalis - Roadmap As shown in the picture, the first step is to update the installer. At the moment it is a JBoss with several Java classes to download from all over the internet for get it up and running.
Next steps are to build adapters for known systems to natively support them. As a person from the technical support line claimed, it is will be available over software assurance in the late 2010. The release of vNext with fully integration into the System Center family is planned for 2011. More information will follow later on, perhaps after the MMS 2010.

For more information’s, see this sources also:

Opalis on Microsoft pathways

Blog: Opalis software availability and roadmap

Technet: Opalis

Add a computer variable using Powershell

Servers mostly run with fixed IP-Addresses. So a question was to automate the server deployment using SCCM that also adds a fixed IP-Address to the server.

While SCCM has the ability to add a fixed IP-Address, the thing to do the deployment automatically was to add the OSD-Variables to the computer object in SCCM.

This can be done using a simple Powershell script and the WMI-Classes brought with SCCM.

# Powershell V2 only (V1 has errors in WMI)
param([string]$computer = ".",[string]$smssite = "MND",[int]$ResourceID=-9999,[string]$variable,[string]$value)

if(($ResourceID -ne -9999) -and ($variable -ne "") -and ($value -ne ""))
{
$pc_class = [WmiClass]""
$pc_class.psbase.Path ="\\$computer\ROOT\SMS\SITE_$($smssite):SMS_MachineSettings"
$pc = $pc_class.createInstance()

$pc.ResourceID = $ResourceID
$pc.SourceSite = $smssite

$pc.psbase.get() 

$pc.MachineVariables = $pc.MachineVariables + [WmiClass]"\\$computer\ROOT\SMS\SITE_$($smssite):SMS_MachineVariable"

$machinevariables = $pc.MachineVariables 

$machinevariables[($machinevariables.count)-1].Name = $variable
$machinevariables[($machinevariables.count)-1].value = $value

$pc.MachineVariables = $machinevariables 

$pc.put()

if($?)
{
  "Variable set"
}
else
{
  "Error in setting variable"
}
}
else
{
  "Not enough arguments given."
}

Adding variables this way is very easy and the correct names can be found in the SCCM documentation (http://technet.microsoft.com/en-us/library/dd252744.aspx).