Enabling Visual Styles

When you use Windows Forms dialogs and windows, you may have noticed that they show differently, depending on whether you launched your script from within the ISE editor or from the powershell.exe console. This is because the ISE editor enables visual styles by...

Test Local User Account Credentials

Here is a snippet that verifies a local user account. Simply submit a username and a password. You get back either $true or $false: $username = 'Administrator' $password = 'P@ssw0rd' $computer = $env:COMPUTERNAME Add-Type -AssemblyName...

Using RegEx to Filter Files

Get-ChildItem supports basic wildcards, but it does not support the rich feature set of regular expressions. If you combine Get-ChildItem with Where-Object, you can easily add this functionality. This example lists all DLL files found in System32 folder that start...

Finding User Account with WMI

WMI represents all kinds of physical and logical entities on your machine. It also has classes that represent user accounts which include both local and domain accounts. This piece of code returns the user account of the currently logged on user: Get-WmiObject -Class...

Increase SQL Server Performance Using Multiple Files

By default, SQL Server databases are comprised of two files: the primary data file (or .mdf) and the log file (or .ldf). It is, however, possible to configure SQL Server databases to use additional files – which can be an effective means of increasing SQL Server...

Tips for Optimizing XML in SQL Server

Tips for Optimizing XML in SQL Server

I’ve worked on a project that used XML heavily inside SQL Server. We really utilized SQL Server’s XML support almost to the full extent, but with some repercussions. As we did our load testing, performance did degrade and we had to step back and adjust how...

1 5 6 7