Wednesday, 18 November 2015

Extract All Azure Management Certificates In Powershell

The following powershell snippet will extract all management certificates for your azure subscriptions into separate PFX files.

You can download your publish settings file from the azure management site.


$azurePublishSettings = "azure-settings.publishsettings"
$nodes = Select-Xml -Path $azurePublishSettings -XPath '//PublishData/PublishProfile/Subscription'
foreach($node in $nodes){
    $node.Node.ManagementCertificate | Out-File "$($node.Node.Name).pfx"
}

No comments:

Post a Comment