Managing Exchange Server 2010 – A PowerShell Approach (Part 2)


Managing Exchange Server 2010 – A PowerShell Approach (Part 2)

In the previous post we talked about how we are going to go about this series, and now it’s time to gear up.

So now let’s get started with Database Management, and for those who missed the Part 1, please follow the below link.
http://blogs.technet.com/b/ashwinexchange/archive/2012/06/20/managing-exchange-server-2010-a-powershell-approach-part-1.aspx
 
As we all know Windows PowerShell uses a "verb-noun" naming system, and hence it is quite a lot easier to understand.

Oh! Wait verb-noun?  What is it? Did anyone ask that?
Then it’s the right time to pause here and review the below mentioned PowerShell training videos. And yes, better learn before it’s too late. So gear up and let’s get the basics clear.

http://blogs.technet.com/b/manojnair/archive/2012/03/06/learn-powershell-from-the-quot-the-scripting-guy-quot-himself.aspx

So now, that all basics are set lets now talk about verb and noun. And in simple terms verb defines what action you are going to take on the corresponding noun.

For example,
Get-Process (verb-noun) - Here action is to get the process from the computer.
Stop-Process (verb-noun) - Here action is to stop the currently running process.

Also in this Part I stress to keep it simple and small so that all can get easily acquainted with PowerShell.

So here is how we are going to tame PowerShell

My 4 Step Rule to tame PowerShell

Step 1
Get-Command
In my words, One Stop Search to understand the available commands

And to have a better understanding, please refer to.
http://blogs.technet.com/b/heyscriptingguy/archive/2012/05/15/find-powershell-commands-by-using-the-get-command-cmdlet.aspx

http://technet.microsoft.com/library/ee176842.aspx

Step 2
Get-Help
This gives the detailed manual of each command.

And below link can get you a detailed idea on this.
http://technet.microsoft.com/en-us/library/ee176848.aspx

Step 3
Parameter Sets
Parameter Sets are the different ways of using the same Windows PowerShell command.
And hence it is very important to understand.

And below link can get you a detailed idea on this.
http://blogs.technet.com/b/heyscriptingguy/archive/2012/05/16/use-the-get-command-powershell-cmdlet-to-find-parameter-set-information.aspx

Step 4
Discover all available properties of a PowerShell Command.

Get-Member is an important command for discovering more about a PowerShell Command.
Here in this series, we were will be focusing on properties available for each command.

Apart from properties, we can also get methods, which I will leave it to reader for experimenting.

<Command> | Get-Member -MemberType property
OR
<Command> -Property * | Get-Member -MemberType property
OR
<Command> <-Filter *> -Property * | Get-Member -MemberType property

This will get you all available properties that you are work around.

 

Step 5
Practice with some examples.

And the good news is that now we are all well equipped to move forward learning the commands.
This part should have provided some amble baseline for anyone to move ahead and crack PowerShell commands.

So let’s get started with our Database Management commands in the next part.

Stay tuned!

Managing Exchange Server 2010 – A PowerShell Approach (Part 3)
http://blogs.technet.com/b/ashwinexchange/archive/2012/06/22/managing-exchange-server-2010-a-powershell-approach-part-3.aspx

Comments (0)

Skip to main content