Scripts

Getting Certificate Information

I spend a lot of time doing Certficate stuff.  So here are two one liners to help.  The first is a generic script.  you can modify it pretty easy to do alerting or whatever.  the second is specific to Skype for Business Get-ChildItem -recurse -path cert:\localmachine\my | select Issuer,NotAfter,NotBefore,SerialNumber,Subject,Thumbprint,@{N=”DNSNameList”;e={$_.DNSNameList}} | export-csv c:\source\certs2.csv -NoTypeInformation Get-CsCertificate | select *,@{n=”SAN”;e={$_.AlternativeNames}} | export-csv c:\source\certs.csv…

Continue Reading

Scripts

Get Remote Certificate information

Sometimes you want to get SSL certficate on a remote machine, not through the get-childitem command, but directly from the web server itself, Linux, windows, any web server.  Here is a oneliner that can help with that. [Code] [net.webrequest]::create(“https://someURL/SomePage”) | select @{n=’certname’;e={$_.servicepoint.Certificate.Getname()}},@{n=’serialNumber’;e={$_.servicepoint.Certificate.GetSerialNumberString()}},@{n=’Issuer’;e={$_.servicepoint.Certificate.GetIssuerName()}} [/code]

Scripts

Get Routing Information

This goes back to another Skype for Business.  Edge Servers, ayae.  It seems that the most common problem with SfB is the configuration of Edge Servers.  This script will help you figure out the routing.  256 is the default route.  True, doing route pring is probabl quicker, but this is PowerShell afterall [code] Get-NetAdapter | %{get-netroute -InterfaceIndex $_.ifindex} | select…

Continue Reading