Answered by:
exporting management packs

Question
-
When I use the following script to export all management packs into html files, I get the error at the bottom for the System.Library MP
get-managementPack | export-managementPack -path "c:\unsealed-mp"
$filelist=get-childitem "c:\unsealed-mp" *.xml -rec
foreach ($filefullname in $filelist) {
$fullname = $filefullname.Name
$filename = $fullname.Substring(0,($fullname.length-$filefullname.extension.length))
$sfile = "c:\unsealed-mp\"+$filename+".xml"
$dfile = "c:\mp-html\"+$filename+".html"
c:\mpviewer.exe $sfile $dfile
}
Error-
Unhandled exception has occured in your application....
Object reference not set to an instance of an object
Details-
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at MPViewer.DatasetCreator.CreateRelationshipsTable()
at MPViewer.DatasetCreator..ctor(ManagementPack managementPack)
at MPViewer.MPViewer.loadManagementPackToolStripMenuItem_Click(Object sender, EventArgs e)
at MPViewer.MPViewer.MPViewer_Shown(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnShown(EventArgs e)
at System.Windows.Forms.Form.CallShownEvent()
at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
MPViewer
Assembly Version: 1.7.0.0
Win32 Version: 1.7.0.0
CodeBase: file:///C:/MPViewer.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Microsoft.EnterpriseManagement.OperationsManager
Assembly Version: 6.0.4900.0
Win32 Version: 6.0.6278.0
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.EnterpriseManagement.OperationsManager/6.0.4900.0__31bf3856ad364e35/Microsoft.EnterpriseManagement.OperationsManager.dll
----------------------------------------
System.Data
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Microsoft.EnterpriseManagement.OperationsManager.Common
Assembly Version: 6.0.4900.0
Win32 Version: 6.0.6278.0
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.EnterpriseManagement.OperationsManager.Common/6.0.4900.0__31bf3856ad364e35/Microsoft.EnterpriseManagement.OperationsManager.Common.dll
----------------------------------------************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
------------------
Any ideas as to what the problem might be?
Thanks.Wednesday, July 1, 2009 11:33 AM
Answers
-
Hi.
It is hard to tell what the real cause is. Another try is this from the Systemcenter Forum blog: http://www.systemcenterforum.org/news/automate-mp-export-for-disaster-recovery/
Best regards, Marnix Wolf (http://thoughtsonopsmgr.blogspot.com/)- Proposed as answer by Shreedevi Padmasini [MSFT] Thursday, July 9, 2009 10:27 PM
- Marked as answer by StuartR Thursday, August 27, 2009 7:06 PM
Wednesday, July 1, 2009 12:26 PM