Friday, September 20, 2013

Powershell Script - More Logparsing Multiple Servers

9/20/2013: I've been putting in a fair amount of time recently repetitively Logparsing the IIS logs on several regions of CAS servers

-- I'm attempting to guage MS Lync 'Exchange Web Services' load and demand on our production CAS's, ahead of new Lync capacity rollouts overseas --

So here's another quicky code chunk that I routinely grab and put to use for Logparsing multiple CAS servers of IIS logs.

Powershell Script - Comment-Based Help Template (Powershell v2)

9/20/2013: Another frequently useful, but occasionally fiddly, feature of Powershell (as of revision 2), is the Comment-Based Help system. The features intention is to make it quick & easy to include the proper values within your script to provide self-assembling get-help output, to make your script as well-documented for other users, as the stock Powershell Cmdlets.

Unfortunately, the area that most frequently breaks when trying to use what I'll refer to as 'CBH', is in the specifics of formatting and placement and exactly which of the various options you may want to include in most of your scripts.

Like a lot of folks I spent some time poking around in the docs and on the web, and figured out the details to make things function, and generally distilled that material down into a simple boilerplate 'Template' that I use within in every new script I write. And since my goal is is to 'share' with the world, I figured I'd post up my template, along with some useful notes on keeping it functioning trouble-free. :)

Powershell Script - Tip: Delimited String "Contants" & Multi-server Logparser scripts

9/19/2013: This is a useful tip that I get some solid routine mileage out of: Using a delimited string variable, to function as an Array Constant. Primary usage is when I want to loop through a set of variant values, and execute the same commands against each value.

Wednesday, September 18, 2013

Powershell - The Big All-in-One All Exchange 2010 DAG Mailboxes in a Site Query

9/18/2013: Here's a one-line Exchange Management Shell Powershell command that will retrieve useful attributes on all Exchange 2010 DAG-hosted mailboxes in the specified site.

Describing the process used by the command:
  1. Retrieve all exchange servers, that are Mailbox Servers, in the designated AD Site,with Exchange version 14 (Exchange 2010)
  2. Then retrieve all databases on those servers, where the ReplicationType attribute is 'Remote' (e.g. DAG replicated)
  3. Then retrieve all mailboxes in those databases, 
  4. And return a list of specific attributes of the mailbox, including a custom field that encapulates a semi-colon-delimited joined string created from all EmailAddresses of the mailbox. 
  5. And finally, export that collection of data to a csv file.

Powershell - Test a file list of mailboxes for Outlook Latency

9/18/2013: Another quicky broad troubleshooting script. This one is aimed at quickly answering those, "Users are reporting slow Outlook Response. Is there an issue?", helpdesk escalations.

Run Test-MAPIConnectivity against a list of mailboxes and report access latency

Powershell - Test all mailboxes in a store

9/18/2013: This is another item I wrote a few years ago to tackle testing of Content Indexing and Exchange Search function, on an Exchange 2007 CCR cluster that was experiencing drive I/O issues, leading to sporadic problems with the update speed and function of the Content Indexing processes:

Powershell - Draw a random mailbox for testing

9/18/2013: Here's something I make use of for quick-evaluating mailbox server health, immediately after a switchover/failover or returning a system to online status after a maintenance outage:

Powershell - Report on Distribution Groups with AcceptMessageOnlyFrom set

9/18/2013: My day job is as a Messaging & Collaboration admin, running 33,000 mailboxes for Hexaware/Unisys. And because I spend most of my day working with Exchange 2010 & 2007, I make a ton of routine use of Powershell, to automate routine tasks, multitask, and generally get more done in less time. The way I look at it, anything I need to do more than once or twice, can probably benefit from taking a little time to code it out and automate it Powershell.

And since I've gotten tons of useful tips and scripting examples from folks like Paul Cunningham  and Shay Levy, I've decided to give back some tips & code-bits to help other folks quickly tackle their own admin needs with Powershell & Exchange Management Shell.