Guy recommends :
Free Solarwinds
VM Console

Solarwinds VM Console Free Download

Find out which of your VMs are a waste of space and which VMs need more resources.



Microsoft's PowerShell in Exchange Server 2007

Introduction to PowerShell in Exchange Server 2007

The long-term reason for learning PowerShell is to configure Exchange 2007 and Windows Server 2008.  However, you can get started with PowerShell right now.  I suggest that you begin by using PowerShell instead of cmd.  My point is that all the commands such as ping, ipconfig and netstat perform in PowerShell just as they do in the cmd.exe shell.  The benefit is that you will get used to the new PS> interface and may even risk a few PowerShell commands.

To prepare for administering the successor to Exchange 2003, I recommend that you download PowerShell and start experimenting with verb-noun instructions at the PS > prompt.  Feel free to copy or modify my examples, better still, create your own scripts.

PowerShell Topics

 ♣

PowerShell and Exchange 2007 Server

Let me be clear, Exchange 2007 has a GUI for its System Manager, however, for a repetitive task or a clever configuration, Microsoft is saying that you need to learn PowerShell.

Microsoft have redesigned Exchange Server 2007 from scratch.  What their research found is that in Exchange 2003, because of the deep nesting, it's difficult to find settings in the System Manager.  Therefore, Microsoft reason, it will be quicker to configure settings with a few crisp instructions from the PowerShell command line, than endlessly searching through menus in the GUI. 

Microsoft's argument goes on to propose that scripting can achieve complex configurations that are not possible from the GUI menu.  For example, I saw a PowerShell script that not only created users and their mailboxes, but also load-balanced the mailboxes between storage groups.  Typical Microsoft, you will be able to get the best of both worlds, begin with the GUI, but press an option to create PowerShell scripts, which you can then modify with a text editor.

PowerShell Example 1: Get Mailbox Exchange Server 2007

Here is a real life task to set a users mailbox quota.  Naturally, you to have Exchange Server 2007 installed before running this PowerShell command:

# PowerShell command to retrieve a user's mailbox.
Get-Mailbox "yourDomain\yourVictim"

# PowerShell command to set the quota
Get-Mailbox "yourDom\yourUser" | set-Mailbox -ProhibitSendQuota 100MB

Guy Recommends:  Solarwinds' Free Bulk Import ToolFree Download of Solarwinds  Bulk Import Tool

Import users from a spreadsheet.  Just provide a list of the users with their fields in the top row, and save as .csv file.  Then launch this FREE utility and match your fields with AD's attributes, click to import the users.  Optionally, you can provide the name of the OU where the new accounts will be born.

There are also two bonus tools in this free download, and all 3 have been approved by Microsoft:

  1. Bulk-import new users into Active Directory.
  2. Seek and zap unwanted user accounts.
  3. Find inactive computers.

Download your FREE bulk import tool.

More PowerShell Exchange Mailbox Cmdlets

  • Database
  • StoreUsageStatistics
  • MailboxDatabase
  • StoreMailbox
  • MailboxServer

By all means experiment with Get, and if you know what you are doing, Mount, Dismount, Clean or even Remove.

PowerShell Example 2: List Roles in Exchange Server 2007

# PowerShell command to list Exchange 2007 Server roles
Get-ExchangeServer -status

PowerShell Example 3: Test-SystemHealth

Before you run the Test-SystemHealth command make sure that your logon account has been delegated the Exchange Server Administrator role and is a member of the local Administrators group for the target server.

# Simple PowerShell Example:
Test-SystemHealth

Example Results:  ServicesRunning

Mailbox Role e.g. MSExchangeSA

Client Access e.g. MSExchangeADTopology

The above are merely examples, the full results list all the Exchange Services and show which are running and which are not.

Exchange Monitor from SolarWindsGuy Recommends: The SolarWinds Exchange Monitor

Here is a free tool to monitor your Exchange Server.  Download and install the utility, then inspect your mail queues, monitor the Exchange server's memory, confirm there is enough disk space and check the CPU utilization. This is the real deal - there is no catch.  SolarWinds provides this fully-functioning product for free, as part of their commitment to supporting the network management community.

Free Download of SolarWinds Exchange Monitor

Parameters for Test-SystemHealth

Get-Help Test-SystemHealth -full

Note:   Although the -Role parameter is 'Reserved', you may like to try these commands depending on your Exchange Server 2010.

-Role Mailbox

-Role ClusterMailbox # (Active Mailbox role)

-Role Gateway # (Edge role)

-Role Bridgehead # (Hub Transport role)

-Role ClientAccess

See more on Test-SystemHealth

Summary of PowerShell and Exchange 2007

PowerShell is a potent scripting language for Exchange Server 2007 servers.  Moreover, one day PowerShell will be Microsoft's standard scripting shell.   One killer reason for learning PowerShell is that you can perform tasks that are not possible through the Exchange System Manager GUI.

If you like this page then please share it with your friends

 


See More Windows PowerShell Examples of Real-life Tasks

PowerShell Tutorials  • PowerShell Examples  • IpConfig  • PowerShell NetSh

Monitor Performance - PowerShell  • Get-Counter  • PowerShell temp

PowerShell WOL (Wake-on-Lan)  • Services   • Windows PowerShell

Please email me if you have a better example script. Also please report any factual mistakes, grammatical errors or broken links, I will be happy to correct the fault.

Download my ebook:Getting Started with PowerShell
Getting Started with PowerShell - only $9.25

You get 36 topics organized into these 3 sections:
   1) Getting Started
   2) Real-life tasks
   3) Examples of Syntax.

In addition to the ebook, you get a PDF version of this  Introduction to PowerShell ebook  It runs to 120 pages of A4.

 *


Custom Search

Guy Recommends: WMI Monitor and It's Free!Solarwinds WMI Monitor

Windows Management Instrumentation (WMI) is one of the hidden treasures of Microsoft operating systems.

Fortunately, Solarwinds have created the Free WMI Monitor so that you can actually see and understand these gems of performance information.  Take the guess work out of which WMI counters to use for applications like Microsoft Active Directory, SQL or Exchange Server.

Download your free copy of WMI Monitor

 

Home Copyright © 1999-2012 Computer Performance LTD All rights reserved

Please report a broken link, or an error.