PowerShell use Regex to Validate a GUID
Posted by Karl Mitschke in PowerShell on June 15, 2010
This simple REGEX one-liner will validate a GUID: 001 $GUID -match("^(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1}$")
Exchange 2007 / 2010 Database Reporting Script
Posted by Karl Mitschke in 2007, 2010, Exchange, V2 on June 6, 2010
In a previous post (https://unlockpowershell.wordpress.com/2010/01/27/exchange-2007-mailbox-database-reporting-script/) I provided a script that we use to report on Our Exchange 2007 mailbox servers. That post garnered a lot of comments because it didn’t work with mount points. We now have a mix of Exchange 2007 and 2010, and I have updated my script – We also now use […]
Exchange 2010 Find Database White Space
Posted by Karl Mitschke in 2010, V2 on June 3, 2010
In Exchange 2007 and earlier, after online defragmentation occurred, you could find your database whitespace by examining the application logs and viewing event ID 1221. This is a pain to do, but luckily for us, Shay Levy posted an excellent article with a PowerShell function for Exchange 2007: http://blogs.microsoft.co.il/blogs/scriptfanatic/archive/2009/08/13/exchange-white-space.aspx That works great for 2007, but […]
PowerShell Get Exchange 2007 Database used space
Posted by Karl Mitschke in 2007, Exchange, PowerShell on April 2, 2010
Aaron on http://powershellcommunity.org asked “I need to get a nice simple list of DB sizes based on how big the mailboxes are, not how big the .edb file is. All of my DB’s are on 100gb disks. A particular EDB might be 90 gigs, but the database could have 40 gigs of whitespace in it. […]
PowerShell find all Server 2008 boxes in a domain
Posted by Karl Mitschke in PowerShell, V1, V2 on March 30, 2010
This script will find all Server 2008 (and Server 2008 R2) machines on your domain: 001 002 003 004 005 006 007 008 009 010 011 012 013 $objDomain = [ADSI]” $objSearcher = New-Object System.DirectoryServices.DirectorySearcher $objSearcher.SearchRoot = $objDomain $objSearcher.Filter = "(&(objectCategory=computer)(operatingsystem=*Server 2008*))" $objSearcher.PageSize = 1000 $colProplist = "*" foreach ($i in $colPropList){$objSearcher.PropertiesToLoad.Add($i)} $colResults = $objSearcher.FindAll() $Server2008 = @() foreach ($objResult in $colResults) { $Server2008 += $objResult.Properties.name } You can change the operatingsystem= line to gather the OS you are interested […]
The 2010 Scripting Games are almost here!
Posted by Karl Mitschke in PowerShell on March 29, 2010
I hope to compete this year, I’d suggest you do too 🙂 Click the picture for more information
Remotely install ‘Win32_Product Class’ on Server 2003
Posted by Karl Mitschke in PowerShell, Server 2003, WMI on February 13, 2010
In a previous post (PowerShell v2 Gather remote software inventory), I lamented the fact that Server 2003 does not include the Win32_Product class by default. (http://blogs.msdn.com/wmi/default.aspx) I was asked to install it on our 500 Server 2003 boxes via a script. I built a few test VM’s, and configured the Win32_Product class via “Add/Remove Windows […]
Exchange 2007 Mailbox Database Reporting Script
Posted by Karl Mitschke in 2007, Exchange, PowerShell, V2 on January 27, 2010
We use the following script to report on Exchange 2007 Mailbox Database usage. I will be modifying it for 2010 soon – watch this space 🙂 001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019 020 021 022 023 024 025 026 027 028 […]
PowerShell Get-Mailbox display SMTP addresses
Posted by Karl Mitschke in 2007, 2010, Exchange, PowerShell, V2 on January 27, 2010
A question was posed recently where a user wanted to see a list of all his mailboxes, with their server, primary SMTP address, and any additional SMTP addresses associated with the mailbox. The user specifically wanted ONLY SMTP addresses. With the help of a scriptblock, I was able to solve this on one line: 001 […]
My scripts will all be V2 from this point on.
Posted by Karl Mitschke in PowerShell, V2 on January 14, 2010
PowerShell V2 has been available for all platforms since late October, 2009, so from now on all my scripts will be tested only on V2. I may post older scripts that work on V1, and in fact my new scripts may as well, but I won’t be testing them unless someone specifically asks for a […]


