PowerShell – Azure – Get Certificate List

| |

Working in Azure creating VMs with certificates it’s helpful to know what you have.

function Get-AzureCertificates
	{
		$i = 1
        $array= @()

        foreach ( $item in (Get-AzureService | Select ServiceName) )
			{
				$Certs = Get-AzureCertificate -ServiceName $item.ServiceName 
				foreach($Cert in $Certs)
					{
						$Object = New-Object System.Object
                        $Object | Add-Member -Type NoteProperty -name "ServiceName" -Value  $item.ServiceName
						$Object | Add-Member -Type NoteProperty -name "Thumbprint" -Value   $Cert.Thumbprint
						$Object | Add-Member -Type NoteProperty -name "ThumbprintAlgorithm" -Value   $Cert.ThumbprintAlgorithm
						$Object | Add-Member -Type NoteProperty -name "URL" -Value   $Cert.Url
						$array += $Object
					}
			}
		$array
    }

Get-AzureCertificates | FT -AutoSize -Wrap

# To Remove Certificate
# Remove-AzureCertificate -ServiceName <ServiceName> -ThumbprintAlgorithm <ThumbprintAlgorithm> -Thumbprint <Thumbprint>
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.