Tag: Import

CLIXML Export Import

Save PowerShell Object to file for Remote Troubleshooting

This is not something new to the most of you PowerShell guys out there, but still there are a lot of IT Pros which do not know about this. Sometimes we have to do some remote troubleshooting without having access to the system itself. The thing you can do is to let the customer send you some screenshots but that doesn’t really show everything and maybe you have to contact the customer like 100 times to get the right information. A better solution is to let the customer to run a PowerShell command or script and send you the output. But even a text file or screenshot of the PowerShell output is not the best solution. If you get a lot of text in a TXT file it is hard to sort it and maybe there are some information missing because the txt output does not include all information of the PowerShell object.

I have started to use a simple method to export PowerShell objects to a XML file and import the object on another system. This can be done by the PowerShell cmdlets Export-Clixml and Import-Clixml.

What I do is, I tell the customer to run the following command to generate a XML with the PowerShell objects about his disks for example.

Get-Disk | Export-Clixml C:\temp\Servername_disks.xml

After I got this XML file, I can import it here on my local system and can work with it as I would be in front of the customer system.

$disks = Import-Clixml C:\mylocaltemp\Servername_disks.xml

CLIXML Export Import

As I said, this is nothing new but this can save you and your customer some time. Of course this works with other objects not just disks ;-) For example you can get Cluster Configurations, Hyper-V Virtual Switch Configurations and much more.


Jeffrey P Snover (Microsoft Technical Fellow and Lead Architect of Windows Server) commented on my blog post and had some great input. If you want to troubleshoot sometimes you often need more information than just one information. To save multiple PowerShell objects into a single file you can use a hashtable to do this:

$info = @{
host = hostname
date = get-date
Disks = Get-disk;
Services = get-service;
Processes = get-process
$info | export-clixml c:\temp\info.xml

You can see more information on this topic in Jeffery Snovers comment on this blog.


Export Templates from Virtual Machine Manager Settings

Export and Import Virtual Machine Manager Templates

If you are working with System Center Virtual Machine Manager and you want to export and import your existing VM or Service Templates. I have a customer scenario where we have two VMM installations. They are using System Center Virtual Machine Manager, Orchestrator, Serivce Manager to deploy new customer environments for their premium SaaS (Software as a Service) hosting solution where they deploy Lync, Exchange and SharePoint fully automated. Here we have a development environment where they test new System Center Orchestrator Runbooks and new Templates in Virtual Machine Manager. After they have a working RunBook with working Templates they export the templates from the dev VMM and import them in the production environment.
Because I was surprise how great this works and I think not a lot of people know about this feature, I created this short step-by-step guide.

Export Templates from Virtual Machine Manager

First select the Templates you want to export and click on the Export button on the Ribbon bar. You can also do a multiple select to export multiple templates.

Export Templates from Virtual Machine Manager

You can than configure the export, with a location, password.

Export Templates from Virtual Machine Manager Settings


You can also select what physical resources which should be exported with the template. For example if you are using the same VHD or VHDX for multiple templates you may want to export this resource only once to save some space.

Export Templates from Virtual Machine Manager physical resources

The export will look kind of like this. The XML files are the templates with the configurations, and in the folders are the physical resources like VHDs, XMLs or other stuff.

Exported Templates from Virtual Machine Manager

Import Templates in Virtual Machine Manager

To import a template just select the exported XML file.

Import Templates in Virtual Machine Manager

You can change or setup the resource of the template, for example you can select an already existing VHD from your Library or an already existing Run As account.

Import Templates in Virtual Machine Manager resources

And you can set the location for the new imported resources (VHDs,…)

Import Templates in Virtual Machine Manager resource location

I hope this shows you how easy an export and import of a Service or VM Template from System Center Virtual Machine Manager is. I like especially how SCVMM handles the additional resources, so you don’t have to import the same VHD every time and you can change Run As accounts very easily.



Import Evernote notes to OneNote 2010

Microsoft OneNote 2010Since I work more and more with Windows 7 I had a look at Microsoft OneNote 2010. Before I used Evernote and I was happy with it. But as I saw OneNote and startet using it, I can’t think being without it. There are alot of features I really love and OneNote 2010 is really nice integrated into Windows 7 and the Office products.

So if you wish to migrate from Evernote to Microsoft OneNote 2010 you can do that in diffrend ways.

  • Import Notes via Outlook (send Evernote Notes via email and import them in Outlook via the Send to OneNote button)
  • Export Notes as HTML and Import Them Into OneNote
  • Import Notes via the OneNote Printer

You can read a great HowTo on howtogeek.com

Btw. Microsoft released also OneNote for iPhone

Sharepoint 2007 or WSS 3.0 export/import

This blog post gives you a quick look at how you can export and import SharePoint 2017 or WSS 3.0 sites.

How to do a Sharepoint site export:

With this command, you can export the SharePoint site.

stsadm -o export -url http://sharepointsite -filename c:\backup\sharepointsite.bak -includeusersecurity -versions 4 -nofilecompression

Hot to do a Sharepoint site import:

With this command, you can import the SharePoint site.

stsadm –o import –url http://sharepointsite -filename c:\backup\sharepointsite.bak –includeusersecurity

More information to stsadm:

If you need more command options, check out the help of the stsadm tool.

C:\stsadm -help export
stsadm.exe -o export
           -url <URL to be exported>
           -filename <export file name>
           [-versions <1-4>
               1 - Last major version for files and list items (default)
               2 - The current version, either the last major or the last minor
               3 - Last major and last minor version for files and list items
               4 - All versions for files and list items]
           [-cabsize <integer from 1-1024 megabytes> (default: 25)]
C:\stsadm -help import
stsadm.exe -o import
           -url <URL to import to>
           -filename <import file name>
           [-updateversions <1-3>
               1 - Add new versions to the current file (default)
               2 - Overwrite the file and all its versions (delete then insert)
               3 - Ignore the file if it exists on the destination]