Lazy Monitoring of Move Requests

This little script helps me out with the ongoing mailbox moves we're doing. I'll kick off the moves on one of the servers, hop on to another box and fire off this script, then head on home. The script does three things for me.

  1. While move requests are processing, it displays and average time to complete as a status bar on the screen.
  2. Every few minutes, it will send out an email to me telling me the status so far.
  3. When completed, it will send out a new email to me and my team that the moves are completed.

Update Forefront license on all servers

We recently had our Forefront 2010 license expire on all our Exchange servers. I found the Forefront 2010 cmdlet "set-fselicensing" will fill this need, but it doesn't work remotely (no -server option). I wrote this little wrapper to set the new license info on all our Exchange servers. This worked if I had remote sessions configured (winrm). Otherwise we had to touch each by hand.

<#
.SYNOPSIS
   Mass Set ForeFront License Info
.DESCRIPTION
   Use Remote Powershell sessions to update forefront licenses
#>

Another Recursive Get Distribution Group Members script

By enclosing a recursive function into another, I am able to clean-up the results and only return a single copy of each name. This fixes some of the problems with my previous script.

I use it like:
$allStaff = get-dlsubmembers "All Staff"

#Grab all child members
Function Get-DLSubMembers {
        #recurses groups to return nested group members.
        [CmdLetBinding()]
        param(
                [parameter(Mandatory=$true)]
                [string]$identity
        )

        Function Get-ChildDLMembers ($identity) {
                #Give me everything that is not a group.

Generate DAG DB distribution report

This code will generate a HTML report detailing the activation preference.

<#
.SYNOPSIS
   Create Graphical report of DAG DB distribution
.DESCRIPTION
   Reads DAG DB layout, then generates an HTML report detailing what server each DB has a copy on and their activation preference.
.PARAMETER <paramName>
   DAGName - Simple Name of a DAG
.EXAMPLE
   .\Report-DAGDBDistribution.ps1 -DAGName DAG5
.SOURCE
        http://stackoverflow.com/questions/9397137/powershell-multidimensional-arrays
#>

[CmdLetBinding()]
param(
        [parameter(Mandatory=$true)]
        [string[]]$DAGNames
)

Distribute Mailboxes during New-MoveRequest

We are starting to move our users in mass to our Exchange 2010 environment. As part of the request, one customer would like to move users based on their locations.

Update (5/1/2013) - I've re-uploaded the script to include my latest revisions. The script now supports a process to 'fill to 250' mailboxes, then move to next db. You set the mailbox db selection method in the script.

New-MoveRequest: Failed to communicate with the mailbox database.

Just spent way too long troubleshooting this issue. I am moving my own mailbox to a new server in order to test the environment. I kept getting the following error when I'd try to kick off the move.

Error:

Summary: 1 item(s). 0 succeeded, 1 failed.
Elapsed time: 00:00:12

Woodford, Eric
Failed

Error:
Failed to communicate with the mailbox database.

MapiExceptionShutoffQuotaExceeded: Unable to save changes. (hr=0x80004005, ec=1245)
Diagnostic context:
Lid: 55847 EMSMDBPOOL.EcPoolSessionDoRpc called [length=2194]

Report of mailbox user has permissions to

Legal question came up in the office. Management wants a break down of all the mailboxes that a specific user has access to. This uses an AD directory searcher to perform the work, so it's much faster than using a straight get-mailbox query like:

get-mailbox -resultsize unlimited | ?{get-mailboxpermission -identity $_.identity -user "domain\user"}

<#
.SYNOPSIS
   Find what mailboxes account has permissions to.
.DESCRIPTION
   Use an AD searcher to find all mailboxes that a specific linked master account
.PARAMETER <paramName>

Report of incoming SMTP traffic.

Wanted to determine why a certain sender sat in the queues for 45 minutes. This script reads the message tracking logs on the current server and then generates a detailed report of message traffic coming into the server.

<#
.SYNOPSIS
        Report on  length of time in queue for sender or senders.
.DESCRIPTION
        reads message tracking logs on local server and reviews the timespan each message was processed.
.PARAMETER <paramName>
        Input:
        Sender (mandatory) - SMTP email address for specific sender or * for all senders

Read NIC driver versions from WMI

Found that we had a number of our HP servers, severely out of date on NIC driver updates. While trying to find someone with access to the HP Insight manager console, I did a little research and put together this script.

Ref: http://social.technet.microsoft.com/Forums/en-US/ITCG/thread/c29bc303-e6...

<#
.SYNOPSIS
   get nic driver versions
.DESCRIPTION
   read nic driver versions from WMI for all servers specified.
#>

$srvers = Get-ExchangeServer
$net = @()
$sc = $srvers.Count
$index = 1
foreach ($s in $srvers) {

Validate email address against GAL

I've been working to fine-tune my script to search message tracking logs, then worked on another script to find out which 'accepted domains' have actual email addresses behind them.

This is my current code to query AD, and determine if an email address exists in the OU you asked it.

function Valid-emailAddress  { 
[CmdLetBinding()]
param( 
        [parameter(mandatory=$true,helpmessage="SMTP email address(es) of everyone to get report")]
        [string[]]$email,
        [parameter(mandatory=$true,helpmessage="LDAP Path to OU containing mailboxes.")]
        [string]$ParentContainerDN
)