250 Hello

Random Musings on Exchange and Virtualization

Exchange 2013 Tip Of The Day – 26 To 50

Exchange 2013 Tip Of The Day – 26 To 50

  • Comments 5
  • Likes

The other Exchange 2013 tips of the day posts can be found here:

Exchange 2013 Tip Of The Day – 1   To 25

Exchange 2013 Tip Of The Day – 51 To 75

Exchange 2013 Tip of The Day – 76 To 93

To obtain the listing below, the following command was used:

$Int = 26;While ($Int -le 50){Get-Tip $Int;  Write-Host; $Int+=1}

 

 

Tip of the day #26:

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:

Get-Mailbox | Format-Table Name,*SMTP*

 

Tip of the day #27:

Want to work with data contained in a CSV file? Use Import-CSV to assign the data to an object. For example, type:

$MyCSV = Import-CSV TestFile.CSV

You can then manipulate the data easily in the Exchange Management Shell. For example, if there is a column called Mailboxes in the CSV data, you can use the following commands to sort or group the data by the Mailboxes column:

To sort: $MyCSV | Sort Mailboxes
To group: $MyCSV | Group Mailboxes

 

Tip of the day #28:

This command spins through all your mailbox servers and reconnects all the uniquely identified but disconnected mailboxes in any one of the mailbox stores:

$Servers = Get-ExchangeServer    
$Servers | `     
Where { $_.IsMailboxServer -Eq '$True' } `     
| ForEach { Get-MailboxStatistics -Server $_.Name `     
Where { $_.DisconnectDate -NotLike '' } `     
| ForEach { Connect-Mailbox -Identity `     
$_.DisplayName -Database $_.DatabaseName} }

 

Tip of the day #29:

Tab completion reduces the number of keystrokes required to complete a cmdlet. Just press the TAB key to complete the cmdlet you're typing. Tab completion kicks in whenever there is a hyphen (-) in the input. For example:

Get-Send<tab>

should complete to Get-SendConnector. You can even use wildcards, such as:

Get-U*P*<tab>

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.

 

Tip of the day #30:

Tab completion reduces the number of keystrokes required to complete a cmdlet. Just press the TAB key to complete the cmdlet you're typing. Tab completion kicks in whenever there is a hyphen (-) in the input. For example:

Get-Send<tab>

should complete to Get-SendConnector. You can even use wildcards, such as:

Get-U*P*<tab>

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.

Tip of the day #31:

Tab completion reduces the number of keystrokes required to complete a cmdlet. Just press the TAB key to complete the cmdlet you're typing. Tab completion kicks in whenever there is a hyphen (-) in the input. For example:

Get-Send<tab>

should complete to Get-SendConnector. You can even use wildcards, such as:

Get-U*P*<tab>

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.

 

Tip of the day #32:

Tab completion reduces the number of keystrokes required to complete a cmdlet. Just press the TAB key to complete the cmdlet you're typing. Tab completion kicks in whenever there is a hyphen (-) in the input. For example:

Get-Send<tab>

should complete to Get-SendConnector. You can even use wildcards, such as:

Get-U*P*<tab>

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.

 

Tip of the day #33:

Want to create a group of test users in your lab? Use this command:

1..100 | ForEach { Net User "User$_" MyPassword=01 /ADD /Domain; Enable-Mailbox "User$_" }

 

Tip of the day #34:

Like the Exchange Management Shell Tip of the Day? Try this:

Get-Tip

 

Tip of the day #35:

Want to set the properties on all or some Outlook Web Access virtual directories? Pipe the output of Get-OwaVirtualDirectory to the Set-OwaVirtualDirectory cmdlet. For example, the following command sets the Gzip level for all Outlook Web Access virtual directories:

Get-OwaVirtualDirectory | Set-OwaVirtualDirectory -GzipLevel High

 

Tip of the day #36:

Want to move your database path to another location? Type:

Move-DatabasePath -EdbFilePath DestFileName

To change the file path setting without moving data, use this command together with the ConfigurationOnly parameter. This command is especially useful for disaster recovery. Caution: Misuse of this cmdlet will cause data loss.

 

Tip of the day #37:

Need an easy way to add a new primary SMTP address to a group of mailboxes? The following command creates a new email address policy that assigns the @contoso.com domain to the primary SMTP address of all mailboxes with Contoso in the company field:

New-EmailAddressPolicy -Name Contoso -RecipientFilter {Company -Eq "Contoso"} -EnabledPrimarySMTPAddressTemplate "@contoso.com"

 

Tip of the day #38:

Want to retrieve a group of objects that have similar identities? You can use wildcard characters with the Identity parameter to match multiple objects. Type:

Get-Mailbox *John*    
Get-ReceiveConnector *toso.com     
Get-JournalRule *discovery*

 

Tip of the day #39:

Want to configure a group of objects that have similar identities? You can use wildcard characters with the Identity parameter when you use a Get cmdlet and pipe the output to a Set cmdlet. Type:

$Mailboxes = Get-Mailbox *John*
  $Mailboxes | Set-Mailbox -ProhibitSendQuota 100MB -UseDatabaseQuotaDefaults $False

This command matches all mailboxes with the name John in the mailbox's identity and sets the ProhibitSendQuota parameter  to 100MB. It also sets the UseDatabaseQuotaDefaults parameter to $False so that the server uses the new quota you specified instead of the database default quota limits.

 

Tip of the day #40:

Forgot what the available parameters are on a cmdlet? Just use tab completion! Type:

Set-Mailbox -<tab>

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:

Set-Mailbox -Prohibit<tab>

 

Tip of the day #41:

Want to add an alias to multiple distribution groups that have a similar name? Type:

$Groups = Get-DistributionGroup *Exchange*    
$Groups | Add-DistributionGroupMember -Member kim

This command adds the alias kim to all distribution groups that contain the word Exchange.

 

Tip of the day #42:

Want to record exactly what happens when you're using the Exchange Management Shell? Use the Start-Transcript 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 Stop-Transcript cmdlet.

Notice that the Start-Transcript cmdlet overwrites the destination text file by default. If you want to append your session to an existing file, use the Append parameter:

Start-Transcript c:\MySession.txt –Append

Tip of the day #43:

Do you have a user who has network access but maintains an external mail account outside your Exchange organization? With Exchange 2013, you can now create mail-enabled users that are regular Active Directory accounts, but also behave like mail-enabled contacts. By using the Enable-MailUser cmdlet, you can add email 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 email messages to that user's external mail account. Type:

Enable-MailUser -Identity <Active Directory Alias> -ExternalEmailAddress <Destination SMTP Address>

 

Tip of the day #44:

Want to change the default prohibit send quota for a mailbox database? Type:

Set-MailboxDatabase <Mailbox Database Name> -ProhibitSendQuota <New Quota Size>

You can specify a bytes qualifier when you use the ProhibitSendQuota parameter. For example, if you want to set the prohibit send quota to 200 megabytes, type:

Set-MailboxDatabase <Mailbox Database Name> ProhibitSendQuota 200MB

You can also configure the IssueWarningQuota parameter and the ProhibitSendReceiveQuota parameter in the same way.

 

Tip of the day #45:

Want to know what version of Exchange Server each of your servers is running? Type:

Get-ExchangeServer | Format-Table Name, *Version*

 

Tip of the day #46:

Want to determine whether a server is running Exchange Server 2013 Standard, Enterprise or Hybrid Edition? Type:

Get-ExchangeServer <Server Name> | Format-Table Name, Edition

If you want to view which edition all your Exchange servers are running, omit the <Server Name> parameter.

 

Tip of the day #47:

Want to create a new resource mailbox that can be used to book a meeting room? Type:

New-Mailbox -Name <Conference Room Name> -UserPrincipalName <SMTP Address> -OrganizationalUnit <Organizational Unit> -Room

This command creates a disabled Active Directory user who has a mailbox that accepts meeting requests from users.

 

Tip of the day #48:

Want to control the properties of email messages sent to a specific domain? Use the RemoteDomain cmdlets. Create a new remote domain by using the New-RemoteDomain cmdlet. Type:

New-RemoteDomain -Name "Contoso.com Configuration" -DomainName contoso.com

Then modify the properties that you want for this remote domain by using the Set-RemoteDomain cmdlet:

Set-RemoteDomain "Contoso.com Configuration" -AutoReplyEnabled $True -AutoForwardEnabled $True

 

Tip of the day #49:

Booleans are parameters that can be evaluated as either $True or $False. 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 $True, $False, 1, or 0. 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 $True:

Set-ManagementRoleAssignment ExampleAssignment -Enabled $True    
Set-ManagementRoleAssignment ExampleAssignment -Enabled 1

 

Tip of the day #50:

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:

Get-MailboxDatabase -Server <Server Name> | Set-MailboxDatabase -DeletedItemRetention 45.00:00:00

You can also apply the same deleted item retention limits or mailbox retention limits across all servers in your organization:

Get-MailboxDatabase | Set-MailboxDatabase -DeletedItemRetention 45.00:00:00 -MailboxRetention 120.00:00:00

 

 

Cheers,

Rhoderick

Can You Help Us? - YES!

If you would like to have Microsoft Premier Field Engineering (PFE) visit your company and assist with the topic(s) presented in this blog post, then please contact your Microsoft Premier Technical Account Manager (TAM) for more information on scheduling and our varied offerings!

If you are not currently benefiting from Microsoft Premier support and you’d like more information about Premier, please email the appropriate contact below, and tell them you how you got introduced!

US

Canada

For all other areas please use the US contact point.

Comments
  • Thanks

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
Post Comment Fixer