﻿<?xml version="1.0" encoding="utf-8"?>
<topic id="11a66da0-5764-4a9b-8be8-11d7ab3cf658" revisionNumber="40">
  <developerConceptualDocument xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>ExTips.xml</title>
  <introduction>
    <table>
      <row>
        <entry>
          <para>Did you know that the <codeInline>Identity</codeInline> parameter is a "positional parameter"? That means you can use:</para>
          <para>
          </para>
          <para>
            <codeInline> Get-Mailbox "user"</codeInline> instead of: <codeInline>Get-Mailbox -Identity "user" </codeInline></para>
          <para>
          </para>
          <para>It's a neat usability shortcut!</para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Tired of typing a long command every time that you want to do something? Alias it! Type:</para>
          <para>
          </para>
          <para>
            <codeInline> Set-Alias GetMre Get-ManagementRoleEntry</codeInline>
          </para>
          <para>
          </para>
          <para>For all the current aliases, type:</para>
          <para>
          </para>
          <para>
            <codeInline> Get-Alias</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Want to see the members of a dynamic distribution group that has a custom filter? Just use the <codeInline>Get-Recipient</codeInline> cmdlet. Type:</para>
          <para>
          </para>
          <para>
            <codeInline> $DDG = Get-DynamicDistributionGroup "Contoso Marketing Managers"</codeInline>
          </para>
          <para>
            <codeInline> Get-Recipient –RecipientPreviewFilter $DDG.RecipientFilter</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>The Exchange Management Shell is a calculator too! Try it directly at a command prompt: </para>
          <para>
          </para>
          <para>
            <codeInline> 1.2343+3123 or (23/435)*2</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Command line SOS! Do you need help? Type:</para>
          <para>
          </para>
          <para>
            <codeInline> Help &lt;cmdlet-name&gt;  or  &lt;cmdlet-name&gt; -?</codeInline>
          </para>
          <para>
          </para>
          <para>You can choose what information to return when you view Help by using the <codeInline>Detailed</codeInline>, <codeInline>Full</codeInline>, and <codeInline>Examples</codeInline> switches: </para>
          <para>
          </para>
          <para>
            <codeInline> Help Get-Mailbox -Detailed</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Want to look at Help for a cmdlet but don't want to read through pages and pages of text in the Shell window? Just use the <codeInline>Online</codeInline> switch with the <codeInline>Get-Help</codeInline> cmdlet. The <codeInline>Online</codeInline> switch tells the Shell to open the online version of the cmdlet's Help topic in your default browser. Type:</para>
          <para>
          </para>
          <para>
            <codeInline> Get-Help &lt;cmdlet&gt; -Online</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>The tilde character (~) should be familiar to Unix users. It represents the shortcut to your root directory. To see what it's evaluated to by default, type:</para>
          <para>
          </para>
          <para>
            <codeInline> Dir ~ </codeInline>
          </para>
          <para>
          </para>
          <para>You can use it as a useful shortcut: </para>
          <para>
          </para>
          <para>
            <codeInline> Cp SomeFile "~\My Documents"</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>CTRL+C is the equivalent of the hard-break command in the Exchange Management Shell. If a command is taking too long to run or you want to cancel an operation quickly, press CTRL+C to stop execution.</para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Pushd and Popd work the same way in the Exchange Management Shell as they do in cmd.exe. Type:</para>
          <para>
          </para>
          <para>
            <codeInline> Pushd &lt;location&gt;</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>XML over everything! The Exchange Management Shell treats XML as a native type, so that you can do interesting things like:</para>
          <para>
          </para>
          <para>
            <codeInline> $Sample = [XML](Get-Content SomeXMLFile.xml)</codeInline>
          </para>
          <para>
          </para>
          <para>This command assigns <codeInline>$Sample</codeInline> to the actual XML object. To see it, type:</para>
          <para>
          </para>
          <para>
            <codeInline> $Sample</codeInline>  </para>
          <para>
          </para>
          <para>To navigate, type:</para>
          <para>
          </para>
          <para>
            <codeInline> $Sample.Prop1.Prop2 </codeInline>
          </para>
          <para>
          </para>
          <para>No need for text parsing when you want to load XML data!</para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Cmdlets that end in "Config" manage singleton configuration, either one per server or organization. For these tasks, you don't have to specify an identity because there is only one instance of the configuration. You may have to specify the <codeInline>Server</codeInline> parameter if the configuration is per server.</para>
        </entry>
      </row>
      <row>
        <entry>
          <para>To get a list of all users on an Exchange 2010 server who aren't Unified Messaging-enabled, type:</para>
          <para>
          </para>
          <para>
            <codeInline> $Mailboxes = Get-Mailbox</codeInline>
          </para>
          <para>
            <codeInline> $Mailboxes | ForEach { If($_.UmEnabled -Eq $False){$_.Name}}</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>To get a list of all users on an Exchange 2010 server who are Unified Messaging-enabled, type:</para>
          <para>
          </para>
          <para>
            <codeInline> $Mailboxes = Get-Mailbox</codeInline>
          </para>
          <para>
            <codeInline> $Mailboxes = | ForEach { If($_.UmEnabled -Eq $True){$_.Name}}</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>To display the user's alias formatted in a table together with the user's Exchange 2010 server name and telephone extension, type: </para>
          <para>
          </para>
          <para>
            <codeInline> Get-Mailbox | Format-Table ServerName,@{e={$_.SamAccountName};Label="User Alias"},@{Expression="Extensions";Label="Telephone numbers"}</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>To display the list of UM IP gateway server names disabled for outbound calling and hunt groups associated with a UM IP gateway server, type:</para>
          <para>
          </para>
          <para>
            <codeInline> $Gateways = Get-UMIPGateway </codeInline>
          </para>
          <para>
            <codeInline> $Gateways | ForEach {If($_.OutCallsAllowed -Eq $False){ "Gateway Name = " +$_.Name;ForEach ($HuntGroup In $_.Huntgroups){"Huntgroups " + $Huntgroup}}}</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>If you want to test all IP Block List providers, you just have to pipe the <codeInline>Get-IpBlockListProvider</codeInline> cmdlet to the <codeInline>Test-IpBlockListProvider</codeInline> cmdlet: </para>
          <para>
          </para>
          <para>
            <codeInline> Get-IpBlockListProvider | Test-IpBlockListProvider -IpAddress 192.168.0.1</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Before you remove an object by using the <codeInline>Remove</codeInline> verb, use the <codeInline>WhatIf</codeInline> parameter to verify the results are what you expect.</para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Sometimes it's useful to convert the output of a cmdlet to a string to interoperate with native cmdlets. For example, type:</para>
          <para>
          </para>
          <para>
            <codeInline> Get-Mailbox | Out-String | Findstr "Administrator"</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Get all Win32 WMI information, such as Perfmon counters and local computer configurations. For example, type:</para>
          <para>
          </para>
          <para>
            <codeInline> Get-WMIObject Win32_PerfRawData_PerfOS_Memory</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Who isn't tired of spam? You can configure real-time block list (RBL) providers with the Exchange Management Shell by running the following two commands:</para>
          <para>
          </para>
          <para>
            <codeInline> Set-IPBlockListProvidersConfig -Enabled $True -ExternalMailEnabled $True</codeInline>
          </para>
          <para>
          </para>
          <para>and then </para>
          <para>
          </para>
          <para>
            <codeInline> Add-IPBlockListProvider -Name &lt;Name of RBL Provider&gt; -LookupDomain &lt;FQDN of RBL Provider&gt; -AnyMatch $True</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Access the event log from the Exchange Management Shell. To retrieve the whole event log, type:</para>
          <para>
          </para>
          <para>
            <codeInline> Get-EventLog Application | Format-List</codeInline>
          </para>
          <para>
          </para>
          <para>To retrieve all Exchange-related events, type:</para>
          <para>
          </para>
          <para>
            <codeInline> Get-EventLog Application | Where { $_.Source -Ilike "*Exchange*" }</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>One benefit of the Exchange Management Shell is that cmdlets can output objects to the console. You can then manipulate this output and organize it in interesting ways. For example, to get a quick view in tabular format, use <codeInline>Format-Table</codeInline>:</para>
          <para>
          </para>
          <para>
            <codeInline> Get-Mailbox | Format-Table Name,Database,RulesQuota</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Forget a property name? Not a problem because you can use wildcard characters to retrieve all properties that match the part of the name that you specify: </para>
          <para>
          </para>
          <para>
            <codeInline> Get-Mailbox | Format-Table Name,*SMTP*</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Want to work with data contained in a CSV file? Use <codeInline>Import-CSV</codeInline> to assign the data to an object. For example, type:</para>
          <para>
          </para>
          <para>
            <codeInline> $MyCSV = Import-CSV TestFile.CSV</codeInline>
          </para>
          <para>
          </para>
          <para>You can then manipulate the data easily in the Exchange Management Shell. For example, if there is a column called <codeInline>Mailboxes</codeInline> in the CSV data, you can use the following commands to sort or group the data by the <codeInline>Mailboxes</codeInline> column:</para>
          <para>
          </para>
          <para>To sort:<codeInline> $MyCSV | Sort Mailboxes </codeInline></para>
          <para>To group:<codeInline> $MyCSV | Group Mailboxes</codeInline></para>
        </entry>
      </row>
      <row>
        <entry>
          <para>This command spins through all your mailbox servers and reconnects all the uniquely identified but disconnected mailboxes in any one of the mailbox stores: </para>
          <para>
          </para>
          <para>
            <codeInline> $Servers = Get-ExchangeServer </codeInline>
          </para>
          <para>
            <codeInline> $Servers | `</codeInline>
          </para>
          <para>
            <codeInline>  Where { $_.IsMailboxServer -Eq '$True' } `</codeInline>
          </para>
          <para>
            <codeInline>  | ForEach { Get-MailboxStatistics -Server $_.Name `</codeInline>
          </para>
          <para>
            <codeInline>  | Where { $_.DisconnectDate -NotLike '' } `</codeInline>
          </para>
          <para>
            <codeInline>  | ForEach { Connect-Mailbox -Identity `</codeInline>
          </para>
          <para>
            <codeInline>    $_.DisplayName -Database $_.DatabaseName} }</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Tab completion reduces the number of keystrokes required to complete a cmdlet. Just press the TAB key to complete the cmdlet you are typing. Tab completion kicks in whenever there is a hyphen (-) in the input. For example:</para>
          <para>
          </para>
          <para>
            <codeInline> Get-Send&lt;tab&gt; </codeInline>
          </para>
          <para>
          </para>
          <para>should complete to <codeInline>Get-SendConnector</codeInline>. You can even use regular expressions, such as:</para>
          <para>
          </para>
          <para>
            <codeInline> Get-U*P*&lt;tab&gt;</codeInline>
          </para>
          <para>
          </para>
          <para>Pressing the TAB key when you enter this command cycles through all cmdlets that match the expression, such as the Unified Messaging Mailbox policy cmdlets.</para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Want to create a group of test users in your lab? Use this command:</para>
          <para>
          </para>
          <para>
            <codeInline> 1..100 | ForEach { Net User "User$_" MyPassword=01 /ADD /Domain; Enable-Mailbox "User$_" }</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Like the Exchange Management Shell Tip of the Day? Try this:</para>
          <para>
          </para>
          <para>
            <codeInline> Get-Tip</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Want to change the authentication settings on an Outlook Web Access virtual directory? Try the following command as an example. It changes authentication from forms-based authentication to Windows authentication: </para>
          <para>
          </para>
          <para>
            <codeInline> Set-OwaVirtualDirectory -Identity "OWA (Default Web Site)" -FormsAuthentication 0 -WindowsAuthentication 1</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Want to set the properties on all or some Outlook Web Access virtual directories? Pipe the output of <codeInline>Get-OwaVirtualDirectory</codeInline> to the <codeInline>Set-OwaVirtualDirectory</codeInline> cmdlet. For example, the following command sets the Gzip level for all Outlook Web Access virtual directories:</para>
          <para>
          </para>
          <para>
            <codeInline> Get-OwaVirtualDirectory | Set-OwaVirtualDirectory -GzipLevel High</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Want to remove an ActiveSync device from a user's device list? Type:</para>
          <para>
          </para>
          <para>
            <codeInline> Remove-ActiveSyncDevice</codeInline>
          </para>
          <para>
          </para>
          <para>This cmdlet can be helpful for troubleshooting devices that don't synchronize successfully with the server.</para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Want to clear all data from a mobile device? Use:</para>
          <para>
          </para>
          <para>
            <codeInline> Clear-ActiveSyncDevice</codeInline>
          </para>
          <para>
          </para>
          <para>Specify a time of day to clear the device, or let the task complete the next time that the device connects to the server.</para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Want to see a list of all devices that synchronize with a user's mailbox? Type:</para>
          <para>
          </para>
          <para>
            <codeInline> Get-ActiveSyncDeviceStatistics </codeInline>
          </para>
          <para>
          </para>
          <para>A variety of information is returned including device name, operating system, and last sync time.</para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Has one of your users asked you to recover their mobile device synchronization password? To return the user's password, type:</para>
          <para>
          </para>
          <para>
            <codeInline> Get-ActiveSyncDeviceStatistics -ShowRecoveryPassword </codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Want to move your database path to another location? Type:</para>
          <para>
          </para>
          <para>
            <codeInline> Move-DatabasePath -EdbFilePath DestFileName</codeInline>
          </para>
          <para>
          </para>
          <para>To change the file path setting without moving data, use this command together with the <codeInline>ConfigurationOnly</codeInline> parameter. This command is especially useful for disaster recovery. Caution: Misuse of this cmdlet will cause data loss.</para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Need an easy way to add a new primary SMTP address to a group of mailboxes? The following command creates a new e-mail address policy that assigns the <codeInline>@contoso.com</codeInline> domain to the primary SMTP address of all mailboxes with <codeInline>Contoso</codeInline> in the company field:</para>
          <para>
          </para>
          <para>
            <codeInline> New-EmailAddressPolicy -Name Contoso -RecipientFilter {Company -Eq "Contoso"} -EnabledPrimarySMTPAddressTemplate "@contoso.com"</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Want to retrieve a group of objects that have similar identities? You can use wildcard characters with the <codeInline>Identity</codeInline> parameter to match multiple objects. Type:</para>
          <para>
          </para>
          <para>
            <codeInline> Get-Mailbox *John*</codeInline>
          </para>
          <para>
            <codeInline> Get-ReceiveConnector *toso.com</codeInline>
          </para>
          <para>
            <codeInline> Get-JournalRule *discovery*</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Want to configure a group of objects that have similar identities? You can use wildcard characters with the <codeInline>Identity</codeInline> parameter when you use a <codeInline>Get</codeInline> cmdlet and pipe the output to a <codeInline>Set</codeInline> cmdlet. Type:</para>
          <para>
          </para>
          <para>
            <codeInline> $Mailboxes = Get-Mailbox *John* </codeInline>
          </para>
          <para>
            <codeInline> $Mailboxes | Set-Mailbox -ProhibitSendQuota 100MB -UseDatabaseQuotaDefaults $False</codeInline>
          </para>
          <para>
          </para>
          <para>This command matches all mailboxes with the name John in the mailbox's identity and sets the <codeInline>ProhibitSendQuota</codeInline> parameter to <codeInline>100MB</codeInline>. It also sets the <codeInline>UseDatabaseQuotaDefaults</codeInline> parameter to <codeInline>$False</codeInline> so that the server uses the new quota you specified instead of the database default quota limits.</para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Forgot what the available parameters are on a cmdlet? Just use tab completion! Type:</para>
          <para>
          </para>
          <para>
            <codeInline> Set-Mailbox -&lt;tab&gt;</codeInline>
          </para>
          <para>
          </para>
          <para>When you type a hyphen (-) and then press the TAB key, you cycle through all the available parameters on the cmdlet. Want to narrow your search? Type part of the parameter's name and then press the TAB key. Type:</para>
          <para>
          </para>
          <para>
            <codeInline> Set-Mailbox -Prohibit&lt;tab&gt;</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Want to add an alias to multiple distribution groups that have a similar name? Type:</para>
          <para>
          </para>
          <para>
            <codeInline> $Groups = Get-DistributionGroup *Exchange* </codeInline>
          </para>
          <para>
            <codeInline> $Groups | Add-DistributionGroupMember -Member kim</codeInline>
          </para>
          <para>
          </para>
          <para>This command adds the alias <codeInline>kim</codeInline> to all distribution groups that contain the word <codeInline>Exchange</codeInline>.</para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Want to record exactly what happens when you're using the Exchange Management Shell? Use the <codeInline>Start-Transcript</codeInline> cmdlet. Anything that you do after you run this cmdlet will be recorded to a text file that you specify. To stop recording your session, use the <codeInline>Stop-Transcript</codeInline> cmdlet. </para>
          <para>
          </para>
          <para>Notice that the <codeInline>Start-Transcript</codeInline> cmdlet overwrites the destination text file by default. If you want to append your session to an existing file, use the <codeInline>Append</codeInline> parameter:</para>
          <para>
          </para>
          <para>
            <codeInline> Start-Transcript c:\MySession.txt -Append</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Do you have a user who has network access but maintains an external mail account outside your Exchange organization? With Exchange Server 2010, you can now create mail-enabled users that are regular Active Directory accounts, but also behave like mail-enabled contacts. By using the <codeInline>Enable-MailUser </codeInline>cmdlet, you can add e-mail contact attributes to any existing Active Directory user who doesn't already have a mailbox on an Exchange server. Users in your Exchange organization will then be able to send e-mail messages to that user's external mail account. Type:</para>
          <para>
          </para>
          <para>
            <codeInline> Enable-MailUser -Identity &lt;Active Directory Alias&gt; -ExternalEmailAddress &lt;Destination SMTP Address&gt;</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Want to change the default prohibit send quota for a mailbox database? Type:</para>
          <para>
          </para>
          <para>
            <codeInline> Set-MailboxDatabase &lt;Mailbox Database Name&gt; -ProhibitSendQuota &lt;New Quota Size&gt; -UseDatabaseQuotaDefaults $False</codeInline>
          </para>
          <para>
          </para>
          <para>You can specify a bytes qualifier when you use the <codeInline>ProhibitSendQuota</codeInline> parameter. For example, if you want to set the prohibit send quota to 200 megabytes, type:</para>
          <para>
          </para>
          <para>
            <codeInline> Set-MailboxDatabase &lt;Mailbox Database Name&gt; ProhibitSendQuota 200MB -UseDatabaseQuotaDefaults $False</codeInline>
          </para>
          <para>
          </para>
          <para>You can also configure the <codeInline>IssueWarningQuota</codeInline> parameter and the <codeInline>ProhibitSendReceiveQuota</codeInline> parameter in the same way.</para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Want to know what version of Exchange Server each of your servers is running? Type:</para>
          <para>
          </para>
          <para>
            <codeInline> Get-ExchangeServer | Format-Table Name, *Version*</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Want to determine whether a server is running Exchange Server 2010 Standard Edition or Exchange Server 2010 Enterprise Edition? Type:</para>
          <para>
          </para>
          <para>
            <codeInline> Get-ExchangeServer &lt;Server Name&gt; | Format-Table Name, Edition</codeInline>
          </para>
          <para>
          </para>
          <para>If you want to view which edition all your Exchange servers are running, omit the <codeInline>&lt;Server Name&gt;</codeInline> parameter.</para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Want to create a new resource mailbox that can be used to book a meeting room? Type:</para>
          <para>
          </para>
          <para>
            <codeInline> New-Mailbox -Name &lt;Conference Room Name&gt; -UserPrincipalName &lt;SMTP Address&gt; -OrganizationalUnit &lt;Organizational Unit&gt; -Room</codeInline>
          </para>
          <para>
          </para>
          <para>This command creates a disabled Active Directory user who has a mailbox that accepts meeting requests from users.</para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Want to control the properties of e-mail messages sent to a specific domain? Use the <codeInline>RemoteDomain</codeInline> cmdlets. Create a new remote domain by using the <codeInline>New-RemoteDomain </codeInline>cmdlet. Type:</para>
          <para>
          </para>
          <para>
            <codeInline> New-RemoteDomain -Name "Contoso.com Configuration" -DomainName contoso.com</codeInline>
          </para>
          <para>
          </para>
          <para>Then modify the properties that you want for this remote domain by using the <codeInline>Set-RemoteDomain</codeInline> cmdlet:</para>
          <para>
          </para>
          <para>
            <codeInline> Set-RemoteDomain "Contoso.com Configuration" -AutoReplyEnabled $True -AutoForwardEnabled $True</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>You can control which features are available to Outlook Web Access users by using the <codeInline>Set-OwaVirtualDirectory</codeInline> cmdlet. Type:</para>
          <para>
          </para>
          <para>
            <codeInline> Set-OwaVirtualDirectory "OWA (Default Web Site)" -ContactsEnabled $True -ChangePasswordEnabled $True</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Booleans are parameters that can be evaluated as either <codeInline>$True</codeInline> or <codeInline>$False</codeInline>. Booleans are typically used as a flag on an object that modifies the behavior of that object. In the Exchange Management Shell, you must supply a Boolean parameter with either a <codeInline>$True</codeInline>, <codeInline>$False</codeInline>, <codeInline>1</codeInline>, or <codeInline>0</codeInline>. No other values are accepted, including True or False. For example, both of the following commands set the enabled state of the ExampleAssignment management role assignment to <codeInline>$True</codeInline>:</para>
          <para>
          </para>
          <para>
            <codeInline> Set-ManagementRoleAssignment ExampleAssignment -Enabled $True</codeInline>
          </para>
          <para>
            <codeInline> Set-ManagementRoleAssignment ExampleAssignment -Enabled 1</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Want an easy way to apply deleted item retention limits across multiple databases and servers? Try the following command to configure deleted item retention across all databases on a specified server:</para>
          <para>
          </para>
          <para>
            <codeInline> Get-MailboxDatabase -Server &lt;Server Name&gt; | Set-MailboxDatabase -DeletedItemRetention 45.00:00:00</codeInline>
          </para>
          <para>
          </para>
          <para>You can also apply the same deleted item retention limits or mailbox retention limits across all servers in your organization:</para>
          <para>
          </para>
          <para>
            <codeInline> Get-MailboxDatabase | Set-MailboxDatabase -DeletedItemRetention 45.00:00:00 -MailboxRetention 120.00:00:00</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Want to know what permissions an Active Directory user account has on a specific mailbox? Use:</para>
          <para>
          </para>
          <para>
            <codeInline> Get-Mailbox &lt;Mailbox to Check&gt; | Get-MailboxPermission -User &lt;Active Directory User&gt;</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Want to know which mailboxes a specific Active Directory user has permissions to? Type:</para>
          <para>
          </para>
          <para>
            <codeInline> $Mailboxes = Get-Mailbox -ResultSize Unlimited </codeInline>
          </para>
          <para>
            <codeInline> $Mailboxes | Get-MailboxPermission -User &lt;Active Directory User&gt; | Format-Table Identity, AccessRights, Deny</codeInline>
          </para>
          <para>
          </para>
          <para>Caution: This command enumerates all the mailboxes in your organization. If you have lots of mailboxes, you may want to target specific mailboxes. </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Want to get a list of the backup status of all mailbox databases in your organization? Type:</para>
          <para>
          </para>
          <para>
            <codeInline> Get-MailboxDatabase -Status | Format-Table Name, Server, *Backup*</codeInline>
          </para>
          <para>
          </para>
          <para>How about just the mailbox databases on a specific server? Type:</para>
          <para>
          </para>
          <para>
            <codeInline> $Databases = Get-MailboxDatabase -Server &lt;Server Name&gt; -Status </codeInline>
          </para>
          <para>
            <codeInline> $Databases | Format-Table Name, *Backup*</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>To retrieve the current status of an Exchange server or database, use the <codeInline>Status</codeInline> parameter. For example:</para>
          <para>
          </para>
          <para>
            <codeInline> Get-ExchangeServer -Status | Format-List</codeInline>
          </para>
          <para>
            <codeInline> Get-MailboxDatabase -Server &lt;Server Name&gt; -Status | Format-List</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Want to view the mounted status of all mailbox databases? Type:</para>
          <para>
          </para>
          <para>
            <codeInline> Get-MailboxDatabase -Status | Format-Table Name, Server, Mounted</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>What's the difference between server-side filtering and client-side filtering? Server-side filtering is used with the recipient and queue cmdlets, which support the <codeInline>Filter</codeInline> parameter, because these cmdlets can return large result sets. The server filters the results by using the criteria you specify and then sends you the filtered results. Client-side filtering can be used with any cmdlet. The entire result set is sent to the client computer, which then filters the data and provides a filtered result set. Client-side filtering uses the <codeInline>Where-Object</codeInline> cmdlet, which can be shortened to <codeInline>Where</codeInline>.</para>
        </entry>
      </row>
      <row>
        <entry>
          <para>With Exchange Server 2010 Unified Messaging, you can redirect unauthenticated callers to certain telephone extensions to an operator instead of to the extension that was dialed. To list users for whom Unified Messaging transfers unauthenticated callers to the operator, instead of to the user, type:</para>
          <para>
          </para>
          <para>
            <codeInline> $Mailboxes = Get-UMMailbox </codeInline>
          </para>
          <para>
            <codeInline> $Mailboxes | Where-Object { $_.AllowUMCallsFromNonUsers -eq `</codeInline>
          </para>
          <para>
            <codeInline> [Microsoft.Exchange.Data.Directory.Recipient.AllowUMCallsFromNonUsersFlags] "None" }</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>You can use client-side filtering to return only the data that you want to see or work with. The following example retrieves all Active Directory user accounts in the Engineering department and puts the results in a table with two columns, <codeInline>Name</codeInline> and <codeInline>Department</codeInline>. By using the <codeInline>ResultSize</codeInline> parameter, the <codeInline>Get-User</codeInline> cmdlet limits the result set to 2,000 users.</para>
          <para>
          </para>
          <para>
            <codeInline> $Users = Get-User -ResultSize 2000 </codeInline>
          </para>
          <para>
            <codeInline> $Users | Where { $_.Department -Eq "Engineering" } | Format-Table Name, Department</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>The special variable <codeInline>$_</codeInline> represents the objects being passed from one cmdlet to another cmdlet in the pipeline. The <codeInline>$_</codeInline> variable is automatically initiated by the Shell and is bound to the current pipeline object. You can access the properties of the object assigned to the <codeInline>$_</codeInline> variable as you would any other object. The following example shows how you can view the <codeInline>Name</codeInline> property of each mailbox object that is passed through the pipeline:</para>
          <para>
          </para>
          <para>
            <codeInline> Get-Mailbox | ForEach { $_.Name }</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>You can import CSV files and treat them as objects by using the <codeInline>Import-Csv</codeInline> cmdlet. Each row in a CSV file becomes an element in an array, and each column becomes a property. You can assign the CSV file to a variable, or you can pipe its contents directly to another cmdlet. In the following example, there are three columns in the CSV file, <codeInline>Name</codeInline>, <codeInline>Alias</codeInline>, and <codeInline>EmailAddress</codeInline>, with several rows that the <codeInline>ForEach</codeInline> cmdlet will cycle through. The data in each row is used to create a new mail contact.</para>
          <para>
          </para>
          <para>
            <codeInline> $CSV = Import-Csv </codeInline>
          </para>
          <para>
            <codeInline> $CSV | ForEach { New-MailContact -Name $_.Name -Alias $_.Alias -ExternalEmailAddress $_.EmailAddress -OrganizationalUnit Users }</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Want to customize your Exchange Management Shell profile? Run the following command to determine the location of your <codeInline>Microsoft.PowerShell_profile.ps1</codeInline> file:</para>
          <para>
          </para>
          <para>
            <codeInline> $Profile</codeInline>
          </para>
          <para>
          </para>
          <para>You may have to create the <codeInline>PSConfiguration</codeInline> folder and <codeInline>Microsoft.PowerShell_profile.ps1</codeInline> file. After you've done that, you can add your favorite functions and aliases, which will be loaded every time that the Exchange Management Shell is opened.</para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Want to see everything that occurs when you run a command? Include the Verbose parameter with the command. This parameter instructs the Exchange Management Shell to display detailed information about each action that the server takes to complete the command. This information can be useful in troubleshooting.</para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Any cmdlet that accepts a size value lets you specify whether the integer value is in kilobytes (KB), megabytes (MB), gigabytes (GB), or terabytes (TB). For example:</para>
          <para>
          </para>
          <para>
            <codeInline> Set-Mailbox "Kim Akers" -ProhibitSendQuota 200MB -UseDatabaseQuotaDefaults $False</codeInline>
          </para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Want to create a new role group for your administrators? Use the <codeInline>New-RoleGroup</codeInline> cmdlet. The <codeInline>New-RoleGroup</codeInline> cmdlet lets you add management roles and specify the members to add to the new role group. Those members will be granted the permissions provided by the management roles. Type:</para>
          <para>
          </para>
          <para>
            <codeInline> New-RoleGroup &lt;role group name&gt; -Roles &lt;role 1&gt;, &lt;role 2&gt;, &lt;role 3...&gt; -Members &lt;member 1&gt;, &lt;member 2&gt;, &lt;member3...&gt;</codeInline>
          </para>
          <para>
          </para>
          <para>Remember, role groups are used to grant permissions to groups of administrators or specialist end users who require special permissions. If you want to manage permissions for end users, use management role assignment policies.</para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Exchange 2010 uses management role groups and management role assignment policies to manage permissions. </para>
          <para>Role groups enable you to grant permissions to groups of administrators and specialist end users. These are people who manage your organization or perform special tasks, like mailbox searches for compliance reasons.</para>
          <para>Role assignment policies enable you to grant permissions to your end users. These permissions include whether users can manage their own distribution groups, edit their own profile information, access voice mail, and more.</para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Management role groups enable you to grant permissions to groups of administrators and specialist end users. These are people who manage your organization or perform special tasks, like mailbox searches for compliance reasons.</para>
          <para>If you want to manage permissions for end users, use management role assignment policies.</para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Management role assignment policies enable you to grant permissions to your end users. These permissions include whether users can manage their own distribution groups, edit their own profile information, access voicemail, and more.</para>
          <para>If you want to manage permissions for administrators and specialist users, use management role groups.</para>
        </entry>
      </row>
      <row>
        <entry>
          <para>Management role assignments determine what management roles are associated with management role groups and management role assignment policies. Role assignments also control what objects users who are members of role groups or assignment policies can modify using the cmdlets available on the associated management roles.</para>
        </entry>
      </row>
      <row>
        <entry>
          <para>The <codeInline>Get-RoleGroupMember</codeInline> cmdlet lists all the members on a management role group. But if you want to get more details about the members of the role group, use the <codeInline>Get-ManagementRoleAssignment</codeInline> cmdlet. The <codeInline>Get-ManagementRoleAssignment</codeInline> cmdlet enables you to view the members of universal security groups that are members of role groups, view the management scope that applies, and more. </para>
        </entry>
      </row>
    </table>
  </introduction>
  <relatedTopics>
  </relatedTopics>
</developerConceptualDocument>
</topic>