IT tutorials
 
Technology
 

Microsoft Exchange Server 2010 : Getting Help (part 1) - Help from the Command Line

9/14/2013 9:37:03 PM
- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019

We have shown you a few simple yet powerful examples of how to use PowerShell and the EMS. Once you dig in and start using the EMS, you will need some references to help you figure out all the syntax and properties of each of the cmdlets.

1. Exchange Server 2010 Help File

A great starting place for just reading about the cmdlets is in the Microsoft Exchange Server 2010 help file. The help file documents explain how to do most common operations both through the graphical user interface as well as through the EMS. Figure 1 shows the online help for how to create a new mailbox. After the procedures for creating the mailbox through the GUI are shown, you will also see the procedures for using the EMS.

After the example for creating the mailbox, you see a link to the New-Mailbox cmdlet that will take you to much more detailed information on that specific cmdlet. The New-Mailbox help topic (shown in Figure 2) will provide you with a great amount of detail about the use of the cmdlet. We strongly recommend you take advantage of the Exchange help file that is included with Exchange Server. In fact, you might want to even copy the file and save it to your workstation. The filename is ExchHelp.chm.

Figure 1. Referring to the online help for creating a new mailbox

Figure 2. Online help for creating a new mailbox using the Exchange Management Shell

2. Help from the Command Line

Information is also available on the cmdlets from within PowerShell. For a good starting point, you can just type the help command and this will give you a good overview of using PowerShell and how to get more help. Table 1 summarizes common methods of getting help on PowerShell and Exchange Management Shell cmdlets.

Table 1. Methods of Getting Help Within the EMS
ActionDescription
helpProvides generic PowerShell help information.
help *Keyword*Lists all cmdlets that contain the keyword. For example, if you want to find all PowerShell v2 cmdlets that work with the Windows event log, you would type help *EventLog*. To find all Exchange cmdlets that work with mailboxes, type Get-ExCommand *mailbox*. You cannot use the help alias to locate all available Exchange cmdlets.
Get-Command *Keyword*Lists all PowerShell cmdlets and files (such as help files) that contain the keyword.
Get-CommandLists all cmdlets (including all PowerShell extensions currently loaded such as the EMS cmdlets).
Get-ExCommandLists all Exchange cmdlets.
Get-PSCommandLists all PowerShell cmdlets.
Help Cmdlet or Get-Help CmdletLists online help for the specified cmdlet and pauses between each screen. Provides multiple views of the online help (such as detailed, full, examples, and default).
Cmdlet -?Lists online help for the specified cmdlet.

When working with help within PowerShell, help topics are displayed based on the view of help that you request. In other words, you can't just type Get-Help and see everything about that cmdlet. The Get-Help cmdlet includes four possible views of help for each cmdlet. Table 2 explains the four primary views along with the parameters view.

Table 2. Possible Output Views for the Get-Help Cmdlet
View OptionExplanation
DefaultLists the minimal information to describe the function of the cmdlet and shows the syntax of the cmdlet
ExampleIncludes a synopsis of the cmdlet and some examples of its usage
DetailedShows more details on a cmdlet, including parameters and parameter descriptions
FullShows all the details available on a cmdlet, including a synopsis of the cmdlet, a detailed description of the cmdlet, parameter descriptions, parameter metadata, and examples
ParametersAllows you to specify a parameter and get help on the usage of just that particular parameter

The Full option for Get-Help includes in its output each parameter's metadata. The meta-data is shown in Table 3.

Table 3. Metadata Output by the Get-Help Cmdlet
OptionPurpose
Required?Is the parameter required? This value is either true or false.
Position?Specifies the position of the parameter. If the position is named, the parameter name has to be included in the parameter list. Most parameters are named. However, the -Identity parameter is 1, which means that it is always the first parameter and the -Identity tag is not required.
Default valueSpecifies what a value will be for a parameter if nothing else is specified. For most parameters this is blank.
Accept pipeline input?Specifies if the parameter will accept input that is piped in from another cmdlet. The value is either true or false.
Accept wildcard characters?Specifies if the parameter accepts wildcard characters such as the asterisk or question mark character. This value is either true or false.

Still not clear about what each view gives you? Perhaps Table 4 can shed some further light on the issue. This table shows you the various sections that are output when using each view option.

Table 4. Information Output for Each Get-Help View
 Default ViewExample ViewDetailed ViewFull View
Synopsis
Detailed description 
Syntax 
Parameters  
Parameter metadata   
Input type   
Return type   
Errors   
Notes   
Example 

To use these parameters, you would use the following Get-Help cmdlet and the view option. For example, to see the example view for the Get-Mailbox, you would type the following:

Get-Help Get-Mailbox -Example

We feel it is important for administrators to understand the available online help options, so let's look at a couple more detailed examples for the Get-MailboxStatisticsGet-MailboxStatistics) that we feel is pretty representative of the EMS cmdlets but that also does not have a huge amount of help information. First, let's look at the default view: cmdlet. We are picking a cmdlet (

Get-Help Get-MailboxStatistics

NAME
Get-MailboxStatistics

SYNOPSIS
Use the Get-MailboxStatistics cmdlet to obtain information about a mailbox,
such as the size of the mailbox, the number of messages it contains, and the
last time it was accessed. In addition, you can get the move history or a move
report of a completed move request.
SYNTAX
Get-MailboxStatistics -Identity <GeneralMailboxIdParameter> [-Archive
<SwitchParameter>] [-DomainController <Fqdn>] [-IncludeMoveHistory
<SwitchParameter>] [-IncludeMoveReport <SwitchParameter>] [<CommonParameters>]



Get-MailboxStatistics -Database <DatabaseIdParameter> [-DomainController
<Fqdn>] [<CommonParameters>]

Get-MailboxStatistics -Server <ServerIdParameter> [-DomainController <Fqdn>]
[<CommonParameters>]

DESCRIPTION
On Mailbox servers only, you can use the Get-MailboxStatistics cmdlet
without parameters. In this case, the cmdlet returns the statistics for all
mailboxes on all databases on the local server.
The Get-MailboxStatistics cmdlet requires at least one of the following
parameters to complete successfully: Server, Database, or Identity.
You can use the Get-MailboxStatistics cmdlet to return detailed move history
and a move report for completed move requests to troubleshoot a move request.
To view the move history, you must pass this cmdlet as an object. Move histories
are retained in the mailbox database and are numbered incrementally, and the last
executed move request is always numbered 0. For more information, see "EXAMPLE 6,"
"EXAMPLE 7," and "EXAMPLE 8" later in this topic.
You can only see move reports and move history for completed move requests.
You need to be assigned permissions before you can run this cmdlet. Although
all parameters for this cmdlet are listed in this topic, you may not have access
to some parameters if they're not included in the permissions assigned to you.
To see what permissions you need, see the "Recipient Provisioning Permissions"
section in the Mailbox Permissions topic.

RELATED LINKS
Online Version http://technet.microsoft.com/EN-US/library/cec76f70-941f-
4bc9-b949-35dcc7671146(EXCHG.140).aspx

REMARKS
To see the examples, type: "get-help Get-MailboxStatistics -examples".
For more information, type: "get-help Get-MailboxStatistics -detailed".
For technical information, type: "get-help Get-MailboxStatistics -full".


The default view (as you could have predicted from Table 4) includes the synopsis, syntax, and detailed description sections. Let's change our approach and look at the example view:

[PS] C:\>Get-Help Get-MailboxStatistics -Examples

NAME
Get-MailboxStatistics

SYNOPSIS
Use the Get-MailboxStatistics cmdlet to obtain information about a mailbox,
such as the size of the mailbox, the number of messages it contains, and
the last time it was accessed. In addition, you can get the move history or
a move report of a completed move request.


-------------------------- EXAMPLE 1 --------------------------

This example retrieves the mailbox statistics for all mailboxes on the
local server. You can use the Get-MailboxStatistics cmdlet without
parameters only on a Mailbox server, and it defaults to the local mailbox
database.

Get-MailboxStatistics

-------------------------- EXAMPLE 2 --------------------------

This example retrieves the mailbox statistics for all mailboxes on
the server MailboxServer01.

Get-MailboxStatistics -Server MailboxServer01

-------------------------- EXAMPLE 3 --------------------------

This example retrieves the mailbox statistics for the specified
mailbox.

Get-MailboxStatistics -Identity contoso\chris

-------------------------- EXAMPLE 4 --------------------------

This example retrieves the mailbox statistics for all mailboxes in the
specified mailbox database.

Get-MailboxStatistics -Database "Mailbox Database"

-------------------------- EXAMPLE 5 --------------------------

This example retrieves the mailbox statistics for all disconnected
mailboxes. This example uses a WHERE clause. The $_ variable is used
to specify the object passed on the pipeline. The -ne operator means
not equal.

Get-MailboxStatistics | Where {$_.DisconnectDate -ne $null}

-------------------------- EXAMPLE 6 --------------------------

This example returns the summary move history for the completed move
request for Ayla Kol's mailbox. If you don't pipeline the output to
the Format-List cmdlet, the move history doesn't display.

Get-MailboxStatistics -Identity AylaKol -IncludeMoveHistory | Format-List


-------------------------- EXAMPLE 7 --------------------------


This example returns the detailed move history for the completed move
request for Ayla Kol's mailbox. This example uses a temporary variable
to store the mailbox statistics object. If the mailbox has been moved
multiple times, there will be multiple move reports. The last move
report is always MoveReport[0].

$temp=Get-MailboxStatistics -Identity AylaKol -IncludeMoveHistory
$temp.MoveHistory[0]


-------------------------- EXAMPLE 8 --------------------------


This example returns the detailed move history and a verbose detailed
move report for Ayla Kol's mailbox. This example uses a temporary
variable to store the move request statistics object and outputs
the move report to a CSV file.

$temp=Get-MailboxStatistics -Identity AylaKol -IncludeMoveReport
$temp.MoveHistory[0] | Export-CSV C:\MoveReport_AylaKol.csv

The example view does not have as much data, but a lot of techies learn by looking at examples so we find this view particularly useful. Next let's look at the detailed view; because this view includes the parameters, it will have quite a bit more information:

[PS] C:\>Get-Help Get-MailboxStatistics -Detailed

NAME
Get-MailboxStatistics

SYNOPSIS
Use the Get-MailboxStatistics cmdlet to obtain information about
a mailbox, such as the size of the mailbox, the number of messages it
contains, and the last time it was accessed. In addition, you can get
the move history or a move report of a completed move request.

SYNTAX
Get-MailboxStatistics -Identity <GeneralMailboxIdParameter>
[-Archive <SwitchParameter>] [-DomainController <Fqdn>]
[-IncludeMoveHistory <SwitchParameter>] [-IncludeMoveReport
<SwitchParameter>] [<CommonParameters>]

Get-MailboxStatistics -Database <DatabaseIdParameter>
[-DomainController <Fqdn>] [<CommonParameters>]

Get-MailboxStatistics -Server <ServerIdParameter>
[-DomainController <Fqdn>] [<CommonParameters>]


DESCRIPTION
On Mailbox servers only, you can use the Get-MailboxStatistics
cmdlet without parameters. In this case, the cmdlet returns the
statistics for all mailboxes on all databases on the local server.
The Get-MailboxStatistics cmdlet requires at least one of the
following parameters to complete successfully: Server, Database,
or Identity.
You can use the Get-MailboxStatistics cmdlet to return detailed
move history and a move report for completed move requests to
troubleshoot a move request. To view the move history, you must pass
this cmdlet as an object.
Move histories are retained in the mailbox database and are numbered
incrementally, and the last executed move request is always numbered 0.
For more information, see "EXAMPLE 6," "EXAMPLE 7," and "EXAMPLE 8"
later in this topic.
You can only see move reports and move history for completed move
requests. You need to be assigned permissions before you can run this
cmdlet. Although all parameters for this cmdlet are listed in this
topic, you may not have access to some parameters if they're not
included in the permissions assigned to you. To see what permissions
you need, see the "Recipient Provisioning Permissions" section in
the Mailbox Permissions topic.

PARAMETERS
-Database <DatabaseIdParameter>
The Database parameter specifies the name of the mailbox
database. When you specify a value for the Database parameter,
the Exchange Management Shell returns statistics for all the mailboxes
on the database specified.
You can use the following values:
* GUID
* Server\Database
* Database
This parameter accepts pipeline input from the Get-MailboxDatabase
cmdlet.

-Identity <GeneralMailboxIdParameter>
The Identity parameter specifies a mailbox. When you specify
a value for the Identity parameter, the command looks up the mailbox
specified in the Identity parameter, connects to the server where the
mailbox resides, and returns the statistics for the mailbox. You can
use one of the following values:
* GUID
* Distinguished name (DN)
* Domain\Account
* User principal name (UPN)
* Legacy Exchange DN
* SMTP address
* Alias



-Server <ServerIdParameter>
The Server parameter specifies the server from which you
want to obtain mailbox statistics. You can use one of the following values:
* Fully qualified domain name (FQDN)
* NetBIOS name
When you specify a value for the Server parameter, the command
returns statistics for all the mailboxes on all the databases, including
recovery databases, on the specified server. If you don't specify this
parameter, the command returns logon statistics for the local server.

-Archive <SwitchParameter>
The Archive switch parameter specifies whether to return
mailbox statistics for the archive mailbox associated with the
specified mailbox. You don't have to specify a value with this parameter.

-DomainController <Fqdn>
The DomainController parameter specifies the fully qualified
domain name (FQDN) of the domain controller that retrieves data from
Active Directory.

-IncludeMoveHistory <SwitchParameter>
The IncludeMoveHistory switch specifies whether to return
additional information about the mailbox that includes the history of
a completed move request, such as status, flags, target database, bad
items, start times, end times, duration that the move request was in
various stages, and failure codes.

-IncludeMoveReport <SwitchParameter>
The IncludeMoveReport switch specifies whether to return a
verbose detailed move report for a completed move request, such as
server connections and move stages.
Because the output of this command is verbose, you should
send the output to a .CSV file for easier analysis.

<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".

-------------------------- EXAMPLE 1 --------------------------

This example retrieves the mailbox statistics for all mailboxes on the
local server. You can use the Get-MailboxStatistics cmdlet without
parameters only on a Mailbox server, and it defaults to the local mailbox
database.

Get-MailboxStatistics


Notice in the previous output we left out most of the examples just to save some page space and because we had already shown them to you earlier. We did so with the full view as well since it contains even more information than the detailed view. The full view includes the meta-data for each parameter as well as examples:

Get-Help Get-MailboxStatistics -Full

NAME
Get-MailboxStatistics

SYNOPSIS
Use the Get-MailboxStatistics cmdlet to obtain information
about a mailbox, such as the size of the mailbox, the number of
messages it contains, and the last time it was accessed. In
addition, you can get the move history or a move report of a
completed move request.

SYNTAX
Get-MailboxStatistics -Identity <GeneralMailboxIdParameter>
[-Archive <SwitchParameter>] [-DomainController <Fqdn>]
[-IncludeMoveHistory <SwitchParameter>] [-IncludeMoveReport
<SwitchParameter>] [<CommonParameters>]

Get-MailboxStatistics -Database <DatabaseIdParameter>
[-DomainController <Fqdn>] [<CommonParameters>]

Get-MailboxStatistics -Server <ServerIdParameter>
[-DomainController <Fqdn>] [<CommonParameters>]

DESCRIPTION
On Mailbox servers only, you can use the Get-MailboxStatistics cmdlet
without parameters. In this case, the cmdlet returns the statistics for all
mailboxes on all databases on the local server.
The Get-MailboxStatistics cmdlet requires at least one of the following
parameters to complete successfully: Server, Database, or Identity.
You can use the Get-MailboxStatistics cmdlet to return detailed move
history and a move report for completed move requests to troubleshoot a move
request. To view the move history, you must pass this cmdlet as an object.
Move histories are retained in the mailbox database and are numbered
incrementally, and the last executed move request is always numbered 0.
For more information, see "EXAMPLE 6," "EXAMPLE 7," and "EXAMPLE 8" later
in this topic.
You can only see move reports and move history for completed move
requests. You need to be assigned permissions before you can run this
cmdlet. Although all parameters for this cmdlet are listed in this topic,
you may not have access to some parameters if they're not included in the
permissions assigned to you.
To see what permissions you need, see the "Recipient Provisioning
Permissions" section in the Mailbox Permissions topic.

PARAMETERS
    -Database <DatabaseIdParameter>
The Database parameter specifies the name of the mailbox
database. When you specify a value for the Database parameter, the
Exchange Management Shell returns statistics for all the mailboxes
on the database specified.
You can use the following values:
* GUID
* Server\Database
* Database
This parameter accepts pipeline input from the Get-MailboxDatabase
cmdlet.

Required? true
Position? Named
Default value
Accept pipeline input? True
Accept wildcard characters? false

-Identity <GeneralMailboxIdParameter>
The Identity parameter specifies a mailbox. When you specify
a value for the Identity parameter, the command looks up the mailbox
specified in the Identity parameter, connects to the server where the
mailbox resides, and returns the statistics for the mailbox. You can
use one of the following values:
* GUID
* Distinguished name (DN)
* Domain\Account
* User principal name (UPN)
* Legacy Exchange DN
* SMTP address
* Alias

Required? true
Position? 1
Default value
Accept pipeline input? True
Accept wildcard characters? false

-Server <ServerIdParameter>
The Server parameter specifies the server from which you
want to obtain mailbox statistics. You can use one of the following
values:
* Fully qualified domain name (FQDN)
* NetBIOS name
When you specify a value for the Server parameter, the
command returns statistics for all the mailboxes on all the databases,
including recovery databases, on the specified server. If you don't



specify this parameter, the command returns logon statistics for
the local server.

Required? true
Position? Named
Default value
Accept pipeline input? True
Accept wildcard characters? false

-Archive <SwitchParameter>
The Archive switch parameter specifies whether to return
mailbox statistics for the archive mailbox associated with the
specified mailbox. You don't have to specify a value with this parameter.

Required? false
Position? Named
Default value
Accept pipeline input? False
Accept wildcard characters? false

-DomainController <Fqdn>
The DomainController parameter specifies the fully
qualified domain name (FQDN) of the domain controller that
retrieves data from Active Directory.

Required? false
Position? Named
Default value
Accept pipeline input? False
Accept wildcard characters? false

-IncludeMoveHistory <SwitchParameter>
The IncludeMoveHistory switch specifies whether to
return additional information about the mailbox that includes
the history of a completed move request, such as status, flags,
target database, bad items, start times, end times, duration that
the move request was in various stages, and failure codes.

Required? false
Position? Named
Default value
Accept pipeline input? False
Accept wildcard characters? false

-IncludeMoveReport <SwitchParameter>
The IncludeMoveReport switch specifies whether to return
a verbose detailed move report for a completed move request, such
as server connections and move stages. Because the output of this



command is verbose, you should send the output to a .CSV file for
easier analysis.

Required? false
Position? Named
Default value
Accept pipeline input? False
Accept wildcard characters? false

<CommonParameters>
This cmdlet supports the common parameters: Verbose,
Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".

INPUTS

OUTPUTS

TERMINATING ERRORS
(Category: )

Type:
Target Object Type:
Suggested Action:

NON-TERMINATING ERRORS
(Category: )

Type:
Target Object Type:
Suggested Action:

-------------------------- EXAMPLE 1 --------------------------

This example retrieves the mailbox statistics for all
mailboxes on the local server. You can use the Get-MailboxStatistics
cmdlet without parameters only on a Mailbox server, and it defaults
to the local mailbox database.

Get-MailboxStatistics


Yes, that's a lot of text for examples of one cmdlet, but we hope that these examples will make it easier for you to quickly learn the capabilities of all cmdlets and how you can use them.

The EMS help system also gives you some options with respect to getting help on parameters. For example, here is an example if you want help on just the -DatabaseGet-MailboxStatistics cmdlet: parameter of the

Get-Help Get-MailboxStatistics -Parameter Database

-Database <DatabaseIdParameter>
The Database parameter specifies the name of the mailbox database.
When you specify a value for the Database parameter, the Exchange
Management Shell returns statistics for all the mailboxes on the
database specified.
You can use the following values:
* GUID
* Server\Database
* Database
This parameter accepts pipeline input from the
Get-MailboxDatabase cmdlet.

Required? true
Position? Named
Default value
Accept pipeline input? True
Accept wildcard characters? false

The -Parameter option also accepts the asterisk (*) wildcard. Here is an example if you want to see help on all the parameters that contain SCLQuarantine for the Set-Mailbox cmdlet:

[PS] C:\>Get-Help Set-Mailbox -Parameter *SCLQuarantine*

-SCLQuarantineEnabled <Nullable>
The SCLQuarantineEnabled parameter specifies whether messages
that meet the SCL threshold specified by the SCLQuarantineThreshold
parameter are quarantined. If a message is quarantined, it's sent
to the quarantine mailbox where the messaging administrator can
review it. You can use the following values:
* $true
* $false
* $null

Required? false
Position? Named
Default value
Accept pipeline input? False
Accept wildcard characters? false


-SCLQuarantineThreshold <Nullable>

The SCLQuarantineThreshold parameter specifies the SCL
at which a message is quarantined, if the SCLQuarantineEnabled
parameter is set to $true. You must specify an integer from 0 through 9
inclusive.

Required? false
Position? Named
Default value
Accept pipeline input? False
Accept wildcard characters? false
 
Others
 
- Microsoft Exchange Server 2010 : Managing Contacts (part 2)
- Microsoft Exchange Server 2010 : Managing Contacts (part 1) - Creating Mail-Enabled Contacts
- Microsoft Lync Server 2010 : Exchange 2010 and SharePoint 2010 Integration - Exchange 2010 Unified Messaging Architecture
- Microsoft Lync Server 2010 : Exchange 2010 and SharePoint 2010 Integration - Call Answering Rules
- Microsoft Lync Server 2010 : Exchange 2010 Unified Messaging
- BlackBerry Development : Pushing Data to Internal Users - Controlling Access to Push, Locating Internal Push Recipients
- BlackBerry Development : Pushing to a Java Application,The Enterprise Push Process
- SQL Server 2008 : Task automation and alerts (part 2) - Event alerts, Error logs
- SQL Server 2008 : Task automation and alerts (part 1) - Maintenance plans
- SQL Server 2008 : Monitoring and automation - Performance Monitor
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
Technology FAQ
- Is possible to just to use a wireless router to extend wireless access to wireless access points?
- Ruby - Insert Struct to MySql
- how to find my Symantec pcAnywhere serial number
- About direct X / Open GL issue
- How to determine eclipse version?
- What SAN cert Exchange 2010 for UM, OA?
- How do I populate a SQL Express table from Excel file?
- code for express check out with Paypal.
- Problem with Templated User Control
- ShellExecute SW_HIDE
programming4us programming4us