One-Liner Random Password Generator

Adding New Nodes to an XML Document

Adding New Items to an XML Document Efficiently If you need to add new items to an XML document that already contains such items, the easiest way is to search for an existing item, then clone it. You can then update the information in the cloned item and insert it...

One-Liner Random Password Generator

Bringing Window in the Foreground

Bringing a Process Window to the Foreground with PowerShell PowerShell can use Add-Type to access internal Windows API functions. This way, it is easy to bring any process window into the foreground. Here is the function you need: #requires -Version 2 function...

One-Liner Random Password Generator

Enabling Telnet Client and Watching Star Wars

By default, the Telnet client is disabled on Windows systems. You can easily enable it with a one liner in PowerShell, though. Just launch a PowerShell with full Administrator privileges, then run this command: PS C:\> dism /online /Enable-Feature...

One-Liner Random Password Generator

Enabling PowerShell Remoting with NTLM

By default, PowerShell remoting uses Kerberos authentication and works only in domain environments, and only when you specify computer names, not IP addresses. Configuring PowerShell Remoting in Peer-to-Peer Network To use PowerShell remoting in other scenarios such...

One-Liner Random Password Generator

Test-Connection with Timeout

The Test-Connection cmdlet implements a simple ping to check whether a system responds to an ICMP request. Unfortunately, you cannot specify a timeout. Test-Connection defaults to a static timeout of 4 seconds: PS C:\> Test-Connection -ComputerName...

One-Liner Random Password Generator

Use Get-CimInstance with DCOM

Using Get-CimInstance as an Alternative to Get-WmiObject PowerShell 3.0 added an alternative to Get-WmiObject: Get-CimInstance seems to work very similar and can retrieve information from the internal WMI service: PS C:\> Get-WmiObject -Class Win32_BIOS...

One-Liner Random Password Generator

Waiting for Process Launch

PowerShell has a built-in support to wait until a process or many processes end: simply use Wait-Process. Understanding Data Marts and Dimensional Modeling There is no support to do the opposite: wait until a process has started. Here is a function that can wait for...

One-Liner Random Password Generator

Try CTRL+SPACE!

Useful Keyboard Shortcuts in PowerShell ISE In the PowerShell ISE, there are two key shortcuts that can help you. Pressing TAB works just like in the console, and each time you press TAB, you get a tabexpansion result. Using CTRL+SPACE for IntelliSense in PowerShell...

One-Liner Random Password Generator

Updating Your Office Phone Number in Active Directory

Updating Active Directory User Information with PowerShell If you have installed the free RSAT tools from Microsoft, you can use PowerShell to update information stored in your AD user account, for example your office phone number. Permissions for Updating Active...

One-Liner Random Password Generator

Cloning Active Directory Security Settings

Whenever you add delegation rights to an AD object (i.e. allow a user to manage the members of an organizational unit), you really invoke a change of security settings for the given AD object. Cloning Active Directory Security Settings Easily AD security descriptors...

One-Liner Random Password Generator

Bulk-Remove Protection for Accidental Deletion in AD

Removing Accidental Deletion Protection By default, AD objects are protected from accidental deletion. To remove this protection for all objects in a given scope (i.e. all objects in an organizational unit and below), try this code: #requires -Version 1 -Modules...

Part 1: Monitoring Analysis Services(SSAS) Performance

Part 1: Monitoring Analysis Services(SSAS) Performance

So you’re a DBA and your manager comes in and says that the BI team wants to install and configure an instance of Analysis Service. Oh and by the way, you are going to be responsible for monitoring the availability and performance of the instance as well as making...

One-Liner Random Password Generator

DBA Triage Using Heatmaps

The word “triage” for me brings up images from MASH re-runs; or memories of emergency room visits with nurses quickly deciding whether you are healthyenough to sit and suffer in the lobby for a few hours. For years, triage in the database performance world meant a...

One-Liner Random Password Generator

Using Green Checkmarks in Console Output

In a previous tip you have seen that the PowerShell console supports all characters available in a TrueType font. You just need to convert the character code to the type "Char". Advanced Example: Using Splatting for Console Output Here is a more advanced example that...

One-Liner Random Password Generator

Using Symbols in Console Output

Did you know that console output can contain special icons like checkmarks? All you need to do is set the console to a TrueType font like "Consolas". To display special characters, use the decimal or hexadecimal character code, for example: [Char]8730 [Char]0x25BA...

One-Liner Random Password Generator

Removing Whitespace (and Line Breaks)

You may know that each string object has a method called Trim() that trims away whitespace both from the beginning and end of a string: $text = ' Hello ' $text.Trim() Trim() and Line Breaks A lesser known fact is that Trim() will also eat away leading and trailing...

One-Liner Random Password Generator

Understanding break, continue, return, and exit

Understanding Control Flow: break, continue, return, and exit Do you know off-hand what "break", "continue", "return", and "exit" do? These are powerful language constructs, and here is a test function to illustrate how different their effects are: 'Starting' function...

One-Liner Random Password Generator

Getting Registry Values and Value Types

Get-ItemProperty can easily read registry values, but you do not get back any information about the registry value type. Get-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion' Alternative Approach Using .NET Here is an alternate approach that uses...

One-Liner Random Password Generator

Tinker, Tailor, Developer, DBA

Tinker, Tailor, Developer, DBA is not intended as a pitch on a slightly less harrowing book or movie than the John Le Carre classic.   Rather, it is a consideration of the career progressions of those working in and around SQL Server and how that progression...