Pages

Showing posts with label Exchange2010. Show all posts
Showing posts with label Exchange2010. Show all posts

Thursday, January 9, 2014

Exchange 2010 DAG DB Distribution Report

This script generates a report on your current DBs, how they are distributed, if they are having issues, etc.. It would be as if you ran Get-MailboxDatabaseCopyStatus and generated a report on their activation preference, current status (mounted, healthy, initializing, etc.), and finally counts (# of copies, # of mailboxes on DB).


 Thursday, January 09, 2014 7:10:46 AM

dag1

DB DAG1S01 DAG1S02 DAG1S03 DAG1S04 DAG1S05 DAG1S06 DB CopiesMbx Count
HR-DB01
3
1*
2
3 80
SALES-DB01
1*
2
3
3 250


This script takes 2 variables:

  • DAGNames - name(s) of the DAGs you want the report on. 
  • FilePath - File path for where to save the HTML report. If left blank, it will put the report in the local drive. 
If you put in multiple DAGs, it will generate an additional report that includes all DAGs that you specified. I have a schedule task that runs the script against all DAGs here, then emails the HTML file to me for review each morning. This report is a great way to see if a server went down and the DBs rolled to another server (red = not mounted on activation preference 1), and see if anything is dismounted or in failing state.


Tuesday, January 7, 2014

Quick Mailbox Size Report

Every once in awhile, some department wants a mailbox size report for all of their users. There are a number of easy ways to do this, but sometimes the easiest ways are the slowest. For example:

get-mailbox | get-mailboxstatistics | select displayname, totalItemSize | export-csv "CSV File"

This works all-and-good until they want additional information, like department, or office! Since this additional information is not stored in the mailbox object, but the user object, you need to meld a get-user with your get-mailboxstatistics. This can easily turn your quick little process into a massive, eight hour query pulling data.

This script:

  1. Specify an OU or Distribution Group, and it will read all the members. 
  2. Read mailbox name, total item size, Office, current size, if using db quotas, issue warning quota, prohibit send quota, when the mailbox was created, last logon and database currently resides on.
  3. Output to CSV report.
  4. Attach it to an email to multiple recipients. 
  5. In email message body, break down the current db limits applied to all dbs in the report. "If UseDatabaseDefaults = True, see the message body for that size limit"

Monday, December 30, 2013

Process ActiveSync Enabled Mailboxes

As an email service provider for a large number of different companies, we need to be able to adapt to their needs. One of those needs was to have larger control over which of their employees can use an ActiveSync device. This meant that we had to lock down a large number of the mailboxes that do not get access. My solution was this script. To run this script you'll need: Exchange Management Tools and Quest ARS Powershell cmdlets.

What this script does: 
  1. Find all ActiveSync enabled mailboxes. I use an AD Directory Searcher method, so reading the values on 100,000 mailboxes only takes a few minutes, not hours.
  2. Reads an "Exchange ActiveSync Opt-in" group, containing groups and/or mailboxes. 
  3. Disables all mailboxes not in the Opt-In group. Enable all mailboxes in Opt-In group.
  4. Look at nested groups in Exchange ActiveSync Opt-in, compare names to ActiveSync Mailbox Policies in Organization, if matches, apply policy to all mailboxes in group. 

Friday, December 27, 2013

Mailbox Move Fails From Exchange 2007 to Exchange 2010

Seldom have I had any major issues with moving mailboxes to Exchange 2010. With my Move Request script, I've bumped the allowed bad items from the default of 0 to 5; of that about a handful needed to be bumped to a larger number to allow them to complete.

The one item that had me stumped for the longest time was an error similar to:

Message        : 
Error: MapiExceptionInvalidParameter: Unable to modify table. (hr=0x80070057, ec=-2147024809)

Report-DAGAPDistribution.ps1

Running through the Exchange 2010 Server Role Requirements Calculator, I manage 3 copies of each database across 6 nodes of a dag. This has helped me distribute databases across all 6 nodes and not leave myself open in case of a disaster. Using my script, I can 1) see if all my existing DBs are correctly set for their activation preference and 2) see what activation options are still open for new DBs.

Thursday, December 26, 2013

My Exchange 2010 Mailbox Move Script

I am coming up to the end of my mailbox moves from Exchange 2007 to Exchange 2010. Over the last year I've worked on this script to help me load balance mailboxes across the databases for each client. Depending on the client, I used various methods for moving and load balancing.

What does the script want?

  1. Identity - Names of each mailbox to move. The script runs a 'get-mailbox' based on what ever you feed it, so it needs to match one of the values it requests. Usually I just run a get-mailbox against whatever data I am provided then feed the script that. 
  2. TargetDatabase - Name of the database(s) to target. You can either list them implicitly or using wildcards. i.e. SAC-DB01,SAC-DB02   or SAC-DB*
  3. DBSelection - This switch is how you want to distribute the mailboxes across your target databases. 
    1. RoundRobin - Default option - divide # of mailboxes by # of target databases, put even number on each. 
    2. LeastFirst - Always find the DB with the least # of mailboxes and move mailboxes there.
    3. FILL - Move up to "FILLMax" value set to each DB, then move to next.
  4. DontAutoSuspendWhenComplete (optional)- By default the script will set the AutoSuspendWhenReadyToComplete switch for each move request. 
  5. BypassDepartmentCheck (optional) - Since each department is getting their own DB when over 250 employees, I use this switch when I mix the smaller departments on a single DB.
  6. ExludedMailboxes (optional) <mailbox name> - Mailboxes to NOT move. If for example, my mailbox selection was all entries on a single DB (get-mailbox -database CCR01-SG1-DB1), I may want to exclude service account mailboxes on that DB. I would list them here.
  7. WhatIf (optional) - doesn't actually schedule move requests, but only shows what would happen if ran.
  8. BatchName (optional) <name> - By default the script will use the department field and schedule all move requests under that batch name. For the HR department, they'd be something like "HR0", "HR1" ... "HR#". This switch lets you specify something different.
Limits:
  • Script will not schedule a request if the mailbox already resides on one of the target databases. 
  • Script will not schedule a request if a move request already exists (in any state). 
  • Script will not schedule a request if using FILL and there are not enough databases with free space.

Tuesday, December 24, 2013

Find Unused Mount Points for Exchange 2010 DBs

Our Exchange 2010 environment has matured enough that I am now working on deleting and moving databases around between the various DAGs. In the coming year, we're even talking about expanding out to a DR site at another data center. With that, I am constantly looking for free drives on our DAS that can be used to provision databases on. Unfortunately there are a number of times that it appears all 25 drives are used, even though only 18 databases reside on the server.

This script compares the existing mounted volumes on a server with the existing databases. It returns the volume names for each of them that don't have a match.

Monday, December 23, 2013

After Migration to Exchange 2010, Client Can't Open Mailbox!

I've been moving mailboxes from Exchange 2007 to Exchange 2010 for about a year now and this is the first time this issue has come up. Of the 50,000 mailboxes moved so far, 90% of them had no issues at all. 9% had minor client issues (lost permissions to distribution list, or can't access resource calendar). 0.9% of those had slightly more aggravating issues like OST files being corrupted or local OAB needing to be downloaded again. That leaves these 40 mailboxes.

Friday, December 20, 2013

ericwoodford.com reborn

It's been a few weeks, and I miss my old blog site. Here are a few things, I've been working on..

Quickly create an array of strings.
I use this when I've been given a list of something (smtp addresses, contact names, etc.) and need to search my servers for them. I cut and paste the code below into a Posh window, then paste in the data.

$s=@();do {$r=Read-Host "+";if($r -ne ""){$s+=$r.trim()}} while ($r -ne "")

Copy and paste from the source (html page, script run, email). When done, hit Enter for a blank line and now I can run my script against this list.