Category Archives: PowerShell

Simple WMI Trace Viewer in PowerShell

Run this script as local Administrator to start tracing WMI events. When you are done tracing hit ENTER to view the results. This does not display all WMI trace events, check the WMI Activity Trace event log in Windows Event … Continue reading

Posted in Debugging, PowerShell | Tagged | Leave a comment

Encrypt Password In CTX1 Encoding With PowerShell

Encrypts the password in a reversible format, the format used in some Citrix applications.

Posted in PowerShell | Tagged | Leave a comment

Misleading PowerShell Exceptions–Example #1

In PowerShell 5.0 on Windows 10 was looking at a script with function not working: The exception thrown by Powershell was: You cannot call a method on a null-valued expression.At C:\Users\chentiangemalc\Documents\Scripts\Test.ps1:5 char:9+     if ([System.String]::IsNullOrWhiteSpace($condition))+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    + CategoryInfo          : InvalidOperation: (:) … Continue reading

Posted in Debugging, PowerShell | Tagged | Leave a comment

Check Validity and Download SSL Certs in PowerShell

Little utility I made to check a list of URLs, their SSL certs, including any URLs they redirect to. The entire certificate chain for each host is also downloaded into %temp%\SslCerts folder Script source files can be downloaded here: https://1drv.ms/u/s!Aj0HCnRwyKPhge1bfpIYIlTJ6IugVQContinue reading

Posted in .NET, PowerShell | Tagged , | Leave a comment

Case of the Missing Printer Ports

A Citrix environment had both Windows Server 2008 R2 published desktops and Windows 7 SP1  VDIs On the Windows 7 VDIs the ports tab on printers added via a print server was always empty. We did a quick comparison between … Continue reading

Posted in API Monitor, Citrix, PowerShell, WinDbg | Tagged | Leave a comment

Retrieve Time Machine Password Last Reset via PowerShell

In diagnosing a machine lockout issue I wanted to find the time that: Machine Password was last set in Active Directory Machine Password was last set locally By default when a machine has a healthy connection to Active Directory you … Continue reading

Posted in .NET, Active Directory, PowerShell | Tagged | Leave a comment

Using PowerShell + Word Interop to Extract Tables from PDFs

I needed to extract some tables from PDFs. If you’ve ever done this before you realise PDF format doesn’t really contain table information, it just contains lines and positions of text. Testing out Tabula http://tabula.technology/ which worked reasonably well, but … Continue reading

Posted in Office, PowerShell | Tagged | Leave a comment