Archive for category PowerShell

PowerShell rename a mailbox folder using Exchange Web Services API

A question came up on the Exchange Server Forum on ‘Is it possible to use PowerShell with a COM access to connect to a remote outlook mailbox and change the name of a folder, especially a custom folder not a system folder like inbox,sent items,contact…etc? I have a project where I need to change […]


Creating random users for a domain

I needed to create some users for my Active Directory domain I created to use in the book “Windows PowerShell Bible” for the Exchange Management chapter. I could have done something simple like: 001 1..120 | ForEach { Net User “BookUser$_” P@ssW0rd /ADD /Domain} This would have created 120 users in the Users ou on my domain, but they would have all […]


PowerShell EWS Managed API Get Calendar Booked Time

As part of our Full-Cost Maturity Model (FMM), my management chain took the number of employees and created a SWAG of our billable time – they then took these billable hours, and in my case divided them by the number of mailboxes in our organization. – That’s how much it costs for 1 Exchange Administrator […]


PowerShell Search AD by GUID

A question was posted on “I have GUID’s from event log’s and such that I need to be able to take and convert to a human readable name” PowerShell can do this with the RSAT tools or the Quest AD cmdlets have this functionality built in, but I like doing things the hard way. […]


PowerShell use Regex to Validate a GUID

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}$")

Leave a comment

Exchange 2007 / 2010 Database Reporting Script

In a previous post ( 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

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: That works great for 2007, but […]

Leave a comment

PowerShell Get Exchange 2007 Database used space

Aaron on 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

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 += $ } You can change the operatingsystem= line to gather the OS you are interested […]


The 2010 Scripting Games are almost here!

I hope to compete this year, I’d suggest you do too 🙂 Click the picture for more information

Leave a comment