Get Pagefile usage of all running VM’s in inventory

Get Pagefile usage of all running VM’s in inventory

function Get-PagefileUsage {
$tabelle = @()
Get-VM | ? {$_.PowerState -like "PoweredOn"} | % { 
   $collect                =   "" | Select Name, PagefileUsage, TotalvRAM
   $collect.Name           =   $_.Name
   $collect.PagefileUsage  =   (Get-WmiObject Win32_PagefileUsage -ComputerName $_.Guest.Hostname).CurrentUsage
   $collect.TotalvRam      =   $_.MemoryMB
   $tabelle += $collect
   }
$tabelle | Export-Csv $env:userprofile\Desktop\PagefileOverview.csv
Write-Host -fore yellow "Tabelle exportiert auf den Desktop als PagefileOverview.csv"
""
}

Advertisements

Split private key from exported pfx file

Split private key from exported pfx file

During setup of some applications, you need specify a certificate and the private key separately. To get the key, you can use OpenSSLto split it out:

pkcs12 -in c:\temp\mmcsecuresite.p12 -out bla.key -nodes -nocerts

Now you have the key and only need to export the certificate without the private key to save it as a Certificate.