database-tools

Finding Services

You can use a keyword search with WMI to find a specific service. The next line will get you all services with the keyword "cert" in its...

read more

Use Server-Side Queries

If you'd like to speed up things, you should try to filter server side instead of client side whenever you query information. For example, this...

read more

Finding 10 Largest Files

You may need to find the largest files for possible clean-up when free space on a drive runs low. One way is to have PowerShell examine all file...

read more

Random Tip of the Day

Get-Random has a dual purpose. It can provide you with a random number and also pick random elements from a collection. So, if you want to get a new...

read more

Sorting Stuff

You can use Sort-Object to sort simple variable types. Have a look at the following: 'Tom', 'Chris', 'Judy', 'Alan'...

read more

Finding Invalid Aliases

When you create new Aliases with Set-Alias, PowerShell does not check whether the target you specify is valid. Instead, this is checked only when...

read more

IPv4 Address Lists

You should try this to get all IPv4 addresses assigned to your system: Get-WMIObject win32_NetworkAdapterConfiguration | Where-Object { $_.IPEnabled...

read more

Generate PC Lists

One easy way of creating lists of PC names or IP address ranges etc is a simple pipeline like this: 1..40 | Foreach-Object {...

read more

Create HTA Files

Another way is to ConvertTo-HTML is a convenient way of converting object results in HTML. However when you open these files, your browser starts...

read more

WMI Server Side Filtering

Whenever you use Get-WMIObject, be sure to minimize resources and maximize speed by using server-side filtering. The next line will use the slow...

read more

List Installed Updates

Using Get-Hotfix is pretty convenient as it serves to list installed updates. Unfortunately, it is not very thorough as it doesn’t retrieve...

read more

Reading Default Values

Each registry key has a default value. It is called (default) when you look into regedit. To read this default value, you can just use this name...

read more