Save PSO parameters for backup/reporting


Hereunder a nice way of saving PSO’s parameters for backup, restore or reporting :

Get-ADFineGrainedPasswordPolicy -Identity NeverExpire | Export-Clixml -Path "C:TempPSO.xml"

This retrieve the PSO named “NeverExpire” and then export the “object” in a XML format to the disk.

If you import the XML back :

Import-Clixml .PSO.xml


You have the PSO object, but without its methods :


If you look at the type name, you’ll see that this is a “Deserialized” version of the original object.

I personally love the ability of exporting object for re-use later. You can use that with all kind of object.

It allows you to do something like :


You can repeat the operation with all parameters, even with the “TimeSpan” parameter type, which can be pretty annoying to type.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.