PowerShell console showing Set-Mailbox command to change PrimarySmtpAddress

Converting SMTP Proxy Addresses to Lowercase

Update: Be aware, this script has not been tested with SIP, X400 or other address types. I recently encountered a question in an online forum where someone asked for a script to convert all of their user’s email addresses to lower case values. While this doesn’t affect the message delivery, it can have an impact on aesthetics when the address is displayed in an external recipient’s email client. An Exchange Email Address Policy can do this to some degree, but I wanted to see how it could be done with PowerShell. ...

May 14, 2012 · 3 min · Mike Crowley
Combined PowerShell cmdlet output

Combining PowerShell Cmdlet Results

A common challenge in PowerShell: mailbox sizes are returned with the Get-MailboxStatistics cmdlet but the email address is not. For that, you need another cmdlet, such as Get-Mailbox. So how do you combine results from multiple cmdlets into a single output? The Solution: Custom Objects with PSObject The approach involves: Creating a custom object with defined properties set to null Populating fields by querying different cmdlets Using foreach loops to process multiple users Outputting results as a unified list Example: Mailbox Report Here’s how to build a mailbox report combining email addresses and storage sizes: ...

April 17, 2012 · 2 min · Mike Crowley

How to Set Windows 7's Login Wallpaper with Group Policies

With Windows XP, you could set your own login background colors and/or wallpaper by modifying the values found in the following registry location: HKEY_USERS\.DEFAULT\Control Panel\Desktop. Windows 7 no longer reads this registry key. Instead you’ve got to complete the multi-step process described in [this article](http://technet.microsoft.com/en-us/library/ee ostensibly). While the steps to set a login wallpaper are not complicated, one challenging limitation is the fact your background wallpaper needs to reside on the workstation’s hard drive. Interestingly, this is not true for the user’s wallpaper, as there are GPO settings to point to a network location. ...

February 17, 2011 · 3 min · Mike Crowley

PowerShell Tip - Running a Service Pack Report - Faster

Here’s a quick tip for running a service pack report against your Active Directory servers using PowerShell. Method 1 The first approach retrieves all computer accounts from Active Directory, then filters results: 1 Get-ADComputer -Properties OperatingSystem, OperatingSystemServicePack -Filter * | Where-Object {$_.OperatingSystem -like '*server*'} | Format-Table name, oper* -autosize This technique retrieves all computer objects before filtering. Method 2 The improved approach applies filtering at query time: 1 Get-ADComputer -Properties OperatingSystem, OperatingSystemServicePack -Filter {OperatingSystem -like '*server*'} | Format-Table name, oper* -autosize By making smarter use of the -Filter switch and filtering before retrieval, this can lead to a significant amount of time saved. ...

February 17, 2011 · 1 min · Mike Crowley

Script for Missing UPNs

PowerShell one-liners for both the native AD module and Quest tools to identify users missing UPN attributes and assign them automatically.

December 14, 2010 · 1 min · Mike Crowley

Released: Active Directory Migration Tool (ADMT) version 3.2

The long-awaited Active Directory Migration Tool v3.2 is released for Windows Server 2008 R2, providing integrated toolset for AD domain migration and restructuring.

June 18, 2010 · 1 min · Mike Crowley