Working with Exchange Cmdlets


You use Exchange cmdlets to manage the configuration of your Exchange organization. These cmdlets work with objects matching a specific set of criteria. The sections that follow provide an overview of the most commonly used cmdlets with their most commonly used syntaxes.

Using General-Purpose Cmdlets

Several general-purpose cmdlets are provided. These cmdlets, along with their syntaxes, follow:

  • Get-ExchangeServer Retrieves a list of all or specified Exchange servers.

    image from book
     Get-ExchangeServer -Domain 'DomainName' [-DomainController 'DCName'] 
    image from book

  • Get-Recipient Retrieves a list of all or specific recipients.

    image from book
     Get-Recipient [-RecipientType 'RecipientIdentifier'] [-Identity 'Identifier'] [Format-List'] [-DomainController 'DCName'] [-OrganizationalUnit 'OUName'] [-Anr 'String'] 
    image from book

Note 

The -Anr parameter is used to specify a string on which to perform ambiguous name resolution. Any value entered is searched for within the specified objects.

Using Contact Management Cmdlets

You can work with contacts using the following cmdlets and command-line syntaxes:

  • Enable-Mailcontact Mail-enables a contact.

    image from book
     Enable-Mailcontact -Identity 'Identifier' -externalEmailAddress 'EmailAddress' [-alias 'Alias'] [-DomainController 'DCName'] 
    image from book

  • Disable-MailContact Mail-disables a contact.

    image from book
     Disable-MailContact -Identity 'Alias' [-DomainController 'DCName'] 
    image from book

  • Get-MailContact Retrieves a list of all or specific mail-enabled contacts.

    image from book
     Get-MailContact [-Identity 'Identifier'] [Format-List'] [-DomainController 'DCName'] [-OrganizationalUnit 'OUName'] [-Anr 'String'] 
    image from book

  • Set-MailContact Changes the specified properties of the specified mail-enabled contact.

    image from book
     Set-MailContact -Identity 'Identifier' [-Alias 'NewAlias'] [-AcceptMessagesOnlyFrom 'Recipient] [-DeliverToForwardingAddress <$false|$true>] [-DisplayName 'Name'][-DomainController 'DCName'] [-EmailAddresses 'ProxyAddress'] [-EmailAddressPolicyEnabled: <$false|$true>] [-ExternalEmailAddress 'ProxyAddress'] [-ForwardingAddress 'Recipient'] [-GrantSendOnBehalfTo 'Mailbox'] [-HiddenFromAddressListsEnabled <$false|$true>] [-MaxReceiveSize 'Size'][-MaxRecipientPerMessage 'Size'] [-MaxSendSize 'Size'][-MessageBodyFormat 'Format'] [-MessageFormat 'Format'][-Name 'Name'] [-PrimarySmtpAddress 'SmtpAddress'] [-RejectMessagesFrom 'Recipient'] [-RejectMessagesFromDLMembers 'Recipient'] [-RequireSenderAuthenticationEnabled: <$false|$true>] [-SimpleDisplayName 'Name']
    image from book

  • Get-Contact Retrieves a list of all or specific contacts, whether mail-enabled or not.

    image from book
     Get-Contact [-DomainController 'DCName'] [-OrganizationalUnit 'OUName'] [-ResultSize 'Size']
    image from book

  • Set-Contact Changes or sets the specified properties of the specified contact.

    image from book
     Set-Contact -Identity 'Identifier' [-AssistantName 'Name'] [-City 'Name'] [-Company 'Name'] [-CountryOrRegion 'Name'] [-Department 'Name'] [-DisplayName 'Name'][-DomainController 'DCName'] [-Fax 'FAXNUMBER'] [-FirstName 'Name'][-HomePhone 'PhoneNumber'] [-Initials 'Value'] [-LastName 'Name'][-Manager 'RecipientId'] [-MobilePhone 'PhoneNumber'] [-Name 'Name'] [-Notes 'Value'] [-Office 'Value'] [-Phone 'PhoneNumber'] [-PostalCode 'Code'] [-SimpleDisplayName 'Name'] [-StateOrProvince 'Value'] [-StreetAddress 'Value'] [-TelephoneAssistant 'Value'] [-Title 'Value'] [-WebPage 'Value'] 
    image from book

Using User Management Cmdlets

You can manage users using the following cmdlets and command-line syntaxes:

  • Get-User Retrieves a list of all or specific Active Directory users.

    image from book
     Get-User [-Identity 'Identifier'] [-DomainController 'DCName'] [-OrganizationalUnit 'OUName'] [-ResultSize 'Size'] [-SortBy 'Value'] 
    image from book

  • Disable-MailUser Mail-disables the specified Active Directory user.

    image from book
     Disable-MailUser -Identity 'Identifier' [-DomainController 'DCName']
    image from book

  • Get-MailUser Retrieves a list of all or specified mail-enabled users.

    image from book
     Get-MailUser [-Identity 'Identifier'] [-DomainController 'DCName'] [-OrganizationalUnit 'OUName'] [-ResultSize 'Size'] [-SortBy 'Value']
    image from book

  • Set-MailUser Sets the specified properties for the specified user.

    image from book
     Set-MailUser [-Identity 'Identifier'] [-AllowMerge <$false|$true>] [-AttachmentFilenames 'Names'] [-BadItemLimit 'Num'] [-ContentKeywords 'Strings'] [-DomainController 'DCName'] [-EndDate 'DateTime'] [-ExcludeFolders 'MapiFolderPath'] [-GlobalCatalog 'GCName'] [-IgnorePolicyMatch <$false|$true>] [-IncludeFolders 'MapiFolderPath'] [-Locale 'Value'] [-MaxThreads 'Num'] [-NTAccountOU 'OUId'] [-PreserveMailboxSizeLimit <$false|$true>] [-ReportFile 'LocalPath'] [-RetryInterval 'TimeSpan'] [-RetryTimeout 'TimeSpan'] [-StartDate 'DateTime'] [-SubjectKeywords 'Values'] [-ValidateOnly <$false|$true>]
    image from book

Using Distribution Group Management Cmdlets

You can work with distribution groups using the following cmdlets and command-line syntaxes:

  • Enable-DistributionGroup Mail-enables an existing universal distribution group.

    image from book
     Enable-DistributionGroup -Identity 'Identifier' [-Alias 'Alias'] [-DisplayName 'Name'] [-DomainController 'DCName'] 
    image from book

  • Disable-DistributionGroup Mail-disables a specified universal distribution group.

    image from book
     Disable-DistributionGroup -Identity 'Identifier' [-DomainController 'DCName'] 
    image from book

  • Get-DistributionGroup Retrieves a list of all or specific mail-enabled universal distribution groups.

    image from book
     Get-DistributionGroup [-Identity 'Identifier'] [-DomainController 'DCName'] [-ManagedBy 'RecipientId'] [-OrganizationalUnit 'OUName'] [-ResultSize 'Size'] [-SortBy 'Value'] 
    image from book

  • Set-DistributionGroup Changes the specified properties of the specified distribution group.

    image from book
     Set-DistributionGroup -Identity 'Identifier' [-Alias 'NewAlias'] [-AcceptMessagesOnlyFrom 'Recipient'] [-DisplayName 'Name'] [-DomainController 'DCName'] [-EmailAddresses 'ProxyAddress'] [-EmailAddressPolicyEnabled <$false|$true>] [-ExpansionServer 'Server'] [-GrantSendOnBehalfTo 'Mailbox'] [-HiddenFromAddressListsEnabled <$false|$true>] [-MaxReceiveSize 'Size'] [-MaxSendSize 'Size'] [-Name 'Name'] [-PrimarySmtpAddress 'SmtpAddress'] [-RejectMessagesFrom 'Recipient'] [-RejectMessagesFromDLMembers 'Recipient'] [-SimpleDisplayName 'Name'] 
    image from book

  • Add-DistributionGroupMember Adds the specified recipient to the universal distribution group.

    image from book
     Add-DistributionGroupMember -Identity 'Identifier' -Member 'RecipientID' [-DomainController 'DCName'] 
    image from book

  • Remove-DistributionGroupMember Removes the specified recipient from the universal distribution group.

    image from book
     Remove-DistributionGroupMember -Identity 'Identifier' -Member 'RecipientID' [-DomainController 'DCName'] 
    image from book

  • Get-DistributionGroupMember Retrieves a list of all of the members of the specified distribution group.

    image from book
     Get-DistributionGroupMember -Identity 'Identifier' [-DomainController 'DCName'] [-ResultSize 'Size'] 
    image from book

  • Get-Group Retrieves a list of all security and distribution groups.

    image from book
     Get-Group [-Identity 'Identifier'] [-DomainController 'DCName'] [-OrganizationalUnit 'OUName'] [-ResultSize 'Size'] [-SortBy 'Value']
    image from book

  • Set-Group Sets the specified properties of the specified Windows group.

    image from book
     Set-Group -Identity 'Identifier' [-DisplayName 'NewDisplayName'] [-DomainController 'DCName'] [-ManagedBy 'RecipientId'] [-Name 'Name'] [-Notes 'Value'] [-SimpleDisplayName 'Name'] 
    image from book

Using Mailbox Management Cmdlets

You can work with mailboxes using the following cmdlets and command-line syntaxes:

  • Enable-Mailbox Mailbox-enables an existing Active Directory user account.

    image from book
     Enable-Mailbox -Identity 'Domain\UserName' -Database 'MailboxDatabase [-Alias'Alias'] [-DomainController'DCName'] [-ManagedFolderMailboxPolicy 'PolicyId'] [-MobileMailboxPolicy 'PolicyId']
    image from book

  • Disable-Mailbox Mailbox-disables the specified user account.

    image from book
     Disable-Mailbox -Identity 'Identifier' [-DomainController 'DCName']
    image from book

  • Set-Mailbox Changes the specified properties of the specified mailbox.

    image from book
     Set-Mailbox -Identity 'Identifier' [-AcceptMessagesOnlyFrom 'RecipientId'] [-AcceptMessagesOnlyFromDLMembers 'RecipientId'] [-Alias 'Alias'] [-AntispamBypassEnabled: <$false|$true>] [-DeliverToMailboxAndForward: <$false|$true>] [-DisplayName 'Name'] [-DomainController 'DCName'] [-EmailAddresses 'ProxyAddresses'] [-EmailAddressPolicyEnabled <$false|$true>] [-ForwardingAddress 'RecipientId'] [-GrantSendOnBehalfTo 'MailboxId>'] [-HiddenFromAddressListsEnabled 'State'] [-IssueWarningQuota 'Size'] [-ManagedFolderMailboxPolicy 'MailboxPolicyId'] [-MaxReceiveSize 'Size'] [-MaxSendSize 'Size'] [-Name 'Name'] [-Office 'Value'] [-OfflineAddressBook 'OfflineAddressBookId'] [-PrimarySmtpAddress 'SmtpAddress'] [-ProhibitSendQuota 'Size'] [-ProhibitSendReceiveQuota 'Size'] [-RecipientLimits 'Size'] [-RejectMessagesFrom 'RecipientId'] [-RejectMessagesFromDLMembers 'RecipientId'] [-RequireSenderAuthenticationEnabled <$false|$true>] [-RetainDeletedItemsFor 'Time'] [-RetainDeletedItemsUntilBackup: <$false|$true>] [-RetentionHoldEnabled <$false|$true>] [-SamAccountName 'Name'] [-UserPrincipalName 'Name'] [-WindowsEmailAddress 'SmtpAddress']
    image from book

  • Get-Mailbox Retrieves a list of all or specific mailboxes.

    image from book
     Get-Mailbox [-Identity 'Identifier'] | [-Database 'DatabaseName'] [-DomainController 'DCName'] [-OrganizationalUnit 'OUName'] [-ResultSize 'Size'] [-SortBy 'Value']
    image from book

  • Get-MailboxStatistics Retrieves summary statistics for all or specific mailboxes, as long as the mailboxes have been logged on to at least once.

    image from book
     Get-MailboxStatistics [-Identity 'Identifier'] [-Database 'MailboxDatabase'] [-Server 'Server']
    image from book

    Move-Mailbox Moves the mailbox of the specified user to the specified server.

    image from book
     Move-Mailbox -Identity 'Identifier' -TargetDatabase 'Server\MailboxDatabase' [-AllowMerge <$false|$true>] [-AttachmentFilenames 'Values>'] [-ContentKeywords 'Values'] [-DomainController 'DCName'] [-EndDate 'DateTime'] [-ExcludeFolders 'MapiFoldePath'] [-GlobalCatalog 'GCName'] [-IgnorePolicyMatch <$false|$true>] [-IncludeFolders 'MapiFolderPath'] [-Locale 'Value'] [-MaxThreads 'Num'] [-NTAccountOU 'OUId'] [-PreserveMailboxSizeLimit 'Switch'] [-ReportFile 'LocalPath'] [-RetryInterval 'TimeSpan'] [-RetryTimeout 'TimeSpan'] [-StartDate 'DateTime'] [-SubjectKeywords 'Values'] [-ValidateOnly: <$false|$true>]
    image from book

Using Database Management Cmdlets

You can manage Exchange databases using the following cmdlets and command-line syntaxes:

  • New-MailboxDatabase Creates a new mailbox database in the specified storage group.

    image from book
     New-MailboxDatabase -Name 'MailboxDatabase' -StorageGroup 'StorageGroup' [-CopyEdbFilePath 'EdbFilePath'] [-DomainController 'DCName'] [-EdbFilePath 'EdbFilePath'] [-HasLocalCopy <$false|$true>] [-OfflineAddressBook 'OABId'] [-PublicFolderDatabase 'DatabaseId'] 
    image from book

  • Remove-MailboxDatabase Removes the specified mailbox database.

    image from book
     Remove-MailboxDatabase -Identity 'MailboxDatabase' [-DomainController 'DCName'] 
    image from book

  • Set-MailboxDatabase Sets the specified properties of the specified mailbox database.

    image from book
     Set-MailboxDatabase [-Identity 'MailboxDatabase'] [-AllowFileRestore <$false|$true>] [-DomainController 'DCName'] [-EventHistoryRetentionPeriod 'TimeSpan'] [-FixedFont <$false|$true>] [-IndexEnabled <$false|$true>] [-IssueWarningQuota 'Size'] [-ItemRetention 'TimeSpan'] [-JournalRecipient 'RecipientId'] [-MailboxRetention 'TimeSpan'] [-MaintenanceSchedule 'Schedule'] [-MountAtStartup <$false|$true>] [-Name 'Name'] [-OfflineAddressBook 'OABId'] [-ProhibitSendQuota 'Size'] [-ProhibitSendReceiveQuota 'Size'] [-PublicFolderDatabase 'DatabaseId'] [-QuotaNotificationSchedule 'Schedule'] [-RestoreInProgress <$false|$true>] [-RetainDeletedItemsUntilBackup <$false|$true>] [-SMimeSignatureEnabled <$false|$true>] 
    image from book

  • Get-MailboxDatabase Retrieves a list of all or specified mailbox databases.

    image from book
     Get-MailboxDatabase [-Identity 'MailboxDatabase'] [-DomainController 'DCName'] Get-MailboxDatabase [-StorageGroup 'StorageGroup'] [-DomainController 'DCName'] Get-MailboxDatabase [-Server 'Server'] [-DomainController 'DCName']
    image from book

  • Mount-Database Mounts the specified mailbox database.

    image from book
     Mount-Database -Identity 'MailboxDatabase' [-DomainController 'DCName'] [-Force <$false|$true>]
    image from book

  • Dismount-Database Dismounts the specified mailbox database.

    image from book
     Dismount-Database -Identity 'MailboxDatabase' [-DomainController 'DCName'] 
    image from book

  • Enable-DatabaseCopy Enables local continuous backup for the specified mail-box database.

    image from book
     Enable-DatabaseCopy -Identity 'MailboxDatabase' [-CopyEdbFilePath 'EdbFilePath'] [-DomainController 'DCName'] 
    image from book

Using Storage Group Management Cmdlets

You can manage Exchange storage groups using the following cmdlets and command-line syntaxes:

  • New-StorageGroup Creates the named storage group on the specified server.

    image from book
     New-StorageGroup -Name 'StorageGroupName' -Server 'Server' [-CircularLoggingEnabled <$false|$true>] [-CopyLogFolderPath 'LocalPath'] [-CopySystemFolderPath 'LocalPath'] [-DomainController 'DCName'] [-HasLocalCopy <$false|$true>] [-LogFolderPath 'LocalPath'] [-SystemFolderPath 'LocalPath'] [-ZeroDatabasePages <$false|$true>] 
    image from book

  • Get-StorageGroup Retrieves a list of all or specified storage groups.

    image from book
     Get-StorageGroup [-Identity 'StorageGroup'] [-DomainController 'DCName'] 
    image from book

  • Set-StorageGroup Changes the name of the specified storage group to the name value provided.

    image from book
     Set-StorageGroup -Identity 'StorageGroup' [-CircularLoggingEnabled <$false|$true>] [-DomainController 'DCName'] [-Name 'Name'] [-ZeroDatabasePages <$false|$true>] 
    image from book

  • Remove-StorageGroup Deletes the specified storage group.

    image from book
     Remove-StorageGroup -Identity 'StorageGroup' [-DomainController 'DCName'] 
    image from book

  • Enable-StorageGroupCopy Enables local continuous backup for the specified storage group, provided all databases within the storage group already have this feature enabled.

    image from book
     Enable-StorageGroupCopy -Identity 'StorageGroup' [-CopyLogFolderPath 'LocalPath'] [-CopySystemFolderPath 'LocalPath'] [-DomainController 'DCName'] [-SeedingPostponed: <$false|$true>] 
    image from book

  • Disable-StorageGroupCopy Disables the continuous backup of the specified storage group.

    image from book
     Disable-StorageGroupCopy -Identity 'StorageGroup' [-DomainController 'DCName'] 
    image from book




Microsoft Exchange Server 2007 Administrator's Pocket Consultant
Microsoft Exchange Server 2007 Administrators Pocket Consultant Second Edition
ISBN: 0735625867
EAN: 2147483647
Year: 2007
Pages: 119

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net