database-tools

FLUSH STATUS surprise?

What does FLUSH STATUS do? We all know that it will simply reset all status variables (except for 'uptime') to same values as immediately...

Finding IP and MAC address

When you query network adapters with WMI, it is not easy to find the active network card. To find the network card(s) that are currently connected...

Performance_schema considerations.

I have for the first time been spending some time trying to understand the performance_schema. It is not easy to understand everything unless you...

Turning SIDs into Real Names

Sometimes, you'd like to turn security identifiers (SIDs) into real names. Here is a function that can do this for you: function SID2Name($sid){...

Converting User Names to SIDs

If you want to translate a valid user name to its security identifier (SID), here is a function to do that for you: function Name2SID($name,...

Changing Units

When you list folder contents, file sizes are in bytes. If you'd rather like to view them in MB or GB, you can use calculated properties, but by...

Closing Excel Gracefully

When you access Microsoft Excel from script, you may have noticed that it never gets removed from memory again, even if you call its Quit() method:...

Formatting Currencies

Formatting numbers as currencies is straight-forward - as long as it is your own currency format: '{0:C}' -f 12.22 If you want to output...

Using Regular Expressions with Dir

When you use Dir (alias: Get-ChildItem) to list folder contents, you can use simple wildcards but they do not give you much control. A much more...

Creating PowerShell Menus

PowerShell is console based, so its default menus are console based as well. To offer choices to your users, here is some sample code to create a...

Scanning Registry for ClassIDs

The Windows Registry is a repository filled with various Windows settings. Get-ItemProperty can read Registry values and accepts wildcards. So, with...

Bypassing Execution Policy

When execution policy prevents execution of PowerShell scripts, you can still execute them. There is a secret parameter called "-" . When you use...