SCCM 2012 R2 – PowerShell Export-CMTaskSequence Fails (Broken by CU1)

This was an old problem that I first ran into last Spring and I gave up after getting nowhere.  I had forgotten all about it until this morning when a friend and fellow SCCM warrior Paul Winstanley wrote and asked me about it as he was getting the same failure.  (Check out his writings here and here.)

First, some background…

Back in May 2014 I was having problems getting the Export-CMDriverPackage and Export-CMTaskSequence PowerShell cmdlets working.  At the time I was looking for a way to easily move content from our development site to our production site.

I sent this email out to the OSD list for MyITforum:


From: listsadmin@lists.myitforum.com [mailto:listsadmin@lists.myitforum.com] On Behalf Of Marable, Mike
Sent: Friday, May 09, 2014 11:11 AM
To: mdtosd@lists.myitforum.com
Subject: [MDT-OSD] SCCM 2012 PowerShell Export Command Problems

I’m having some troubles with the PowerShell cmdlets Export-CMDriverPackage and Export-CMTaskSequence.

In both cases, I follow the syntax in the samples found in the TechNet documentation:

Export-CMTaskSequence

http://technet.microsoft.com/en-us/library/jj822005(v=sc.20).aspx

Export-CMDriverPackage

http://technet.microsoft.com/en-us/library/jj850196(v=sc.20).aspx

But I get an error indicating that I’m missing a parameter.

Export-CMTaskSequence -ExportFilePath \\CM12DEV01\SCCMOSD2012_PROD\DV100013_Mike.zip -WithDependence $false -WithContent $false -Name "DEV2012 - Nomad Build Server - Build v 2.0"

Export-CMTaskSequence : Value cannot be null.
Parameter name: parameterName
At line:1 char:1
+ Export-CMTaskSequence -ExportFilePath \CM12DEV01\SCCMOSD2012_PROD\DV100013_M …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidArgument: (Microsoft.Confi…SequenceCommand:ExportTaskSequenceCommand) [Export-C
MTaskSequence], ArgumentNullException
+ FullyQualifiedErrorId : ResultObjectParamWrongType,Microsoft.ConfigurationManagement.Cmdlets.Osd.Commands.Export
TaskSequenceCommand

I get the same results when attempting to use the Expoert-CMDriverPackage as well.

I have no problems using the Export-CMPackage cmdlet.  That works perfectly.  I’ve even tried using the PowerShell ISE and filling in the parameters on the form but that doesn’t work either.

I get the problem regardless of running PowerShell “As Admin” or not.

I don’t know what I’m missing.

Any ideas?


The part that threw me was the nonsense error description:

Export-CMTaskSequence : Value cannot be null.
Parameter name: parameterName

Parameter name “parameterName”?  What the???

Well I gave up and moved on to other methods for moving between development and production sites.

Fast forward to today….

This morning I got into the office and found an email from Paul. He was running into the same failure of the cmdlets.  It has been a year, so I crossed my fingers and fired up PowerShell.  I gave it a shot….

… and it worked!

What changed?

Back in May we were running ConfigMgr 2012 R2 with CU1.  Today we’re running CU3.

I gave the cmdlets a try on my lab server which was running ConfigMgr 2012 R2 RTM…

… and they worked!

Did CU1 break them?  I upgraded my lab server to CU1 and tried again…

… and it failed!

Failure

Upgraded my lab server to CU3 and tried again…

… and it worked!

Success

I checked with Paul and he confirmed that they are running CU1 in their site.

Just to round out the story, I then dug up the release notes for CU2 and CU3 to see if the issue with these cmdlets were ever officially addressed.

Description of Windows PowerShell changes in Cumulative Update 2 for System Center 2012 R2 Configuration Manager

CU2_EXP-CMDriver

So CU2 calls out fixing the problem with Export-CMDriverPackage but neither CU2 nor CU3 call out fixing Export-CMTaskSequence.

The moral of the story?

If you’re getting wonky results using the PowerShell cmdlets for ConfigMgr, take a look at the Cumulative Update you’re running.

Advertisements

Posted on April 8, 2015, in Configuration Manager, PowerShell, SCCM and tagged , , , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: