Microsoft Exchange Server 2007 Administrators Pocket Consultant Second Edition
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.
Get-ExchangeServer -Domain 'DomainName' [-DomainController 'DCName']
-
Get-Recipient Retrieves a list of all or specific recipients.
Get-Recipient [-RecipientType 'RecipientIdentifier'] [-Identity 'Identifier'] [Format-List'] [-DomainController 'DCName'] [-OrganizationalUnit 'OUName'] [-Anr 'String']
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.
Enable-Mailcontact -Identity 'Identifier' -externalEmailAddress 'EmailAddress' [-alias 'Alias'] [-DomainController 'DCName']
-
Disable-MailContact Mail-disables a contact.
Disable-MailContact -Identity 'Alias' [-DomainController 'DCName']
-
Get-MailContact Retrieves a list of all or specific mail-enabled contacts.
Get-MailContact [-Identity 'Identifier'] [Format-List'] [-DomainController 'DCName'] [-OrganizationalUnit 'OUName'] [-Anr 'String']
-
Set-MailContact Changes the specified properties of the specified mail-enabled contact.
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']
-
Get-Contact Retrieves a list of all or specific contacts, whether mail-enabled or not.
Get-Contact [-DomainController 'DCName'] [-OrganizationalUnit 'OUName'] [-ResultSize 'Size']
-
Set-Contact Changes or sets the specified properties of the specified contact.
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']
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.
Get-User [-Identity 'Identifier'] [-DomainController 'DCName'] [-OrganizationalUnit 'OUName'] [-ResultSize 'Size'] [-SortBy 'Value']
-
Disable-MailUser Mail-disables the specified Active Directory user.
Disable-MailUser -Identity 'Identifier' [-DomainController 'DCName']
-
Get-MailUser Retrieves a list of all or specified mail-enabled users.
Get-MailUser [-Identity 'Identifier'] [-DomainController 'DCName'] [-OrganizationalUnit 'OUName'] [-ResultSize 'Size'] [-SortBy 'Value']
-
Set-MailUser Sets the specified properties for the specified user.
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>]
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.
Enable-DistributionGroup -Identity 'Identifier' [-Alias 'Alias'] [-DisplayName 'Name'] [-DomainController 'DCName']
-
Disable-DistributionGroup Mail-disables a specified universal distribution group.
Disable-DistributionGroup -Identity 'Identifier' [-DomainController 'DCName']
-
Get-DistributionGroup Retrieves a list of all or specific mail-enabled universal distribution groups.
Get-DistributionGroup [-Identity 'Identifier'] [-DomainController 'DCName'] [-ManagedBy 'RecipientId'] [-OrganizationalUnit 'OUName'] [-ResultSize 'Size'] [-SortBy 'Value']
-
Set-DistributionGroup Changes the specified properties of the specified distribution group.
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']
-
Add-DistributionGroupMember Adds the specified recipient to the universal distribution group.
Add-DistributionGroupMember -Identity 'Identifier' -Member 'RecipientID' [-DomainController 'DCName']
-
Remove-DistributionGroupMember Removes the specified recipient from the universal distribution group.
Remove-DistributionGroupMember -Identity 'Identifier' -Member 'RecipientID' [-DomainController 'DCName']
-
Get-DistributionGroupMember Retrieves a list of all of the members of the specified distribution group.
Get-DistributionGroupMember -Identity 'Identifier' [-DomainController 'DCName'] [-ResultSize 'Size']
-
Get-Group Retrieves a list of all security and distribution groups.
Get-Group [-Identity 'Identifier'] [-DomainController 'DCName'] [-OrganizationalUnit 'OUName'] [-ResultSize 'Size'] [-SortBy 'Value']
-
Set-Group Sets the specified properties of the specified Windows group.
Set-Group -Identity 'Identifier' [-DisplayName 'NewDisplayName'] [-DomainController 'DCName'] [-ManagedBy 'RecipientId'] [-Name 'Name'] [-Notes 'Value'] [-SimpleDisplayName 'Name']
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.
Enable-Mailbox -Identity 'Domain\UserName' -Database 'MailboxDatabase [-Alias'Alias'] [-DomainController'DCName'] [-ManagedFolderMailboxPolicy 'PolicyId'] [-MobileMailboxPolicy 'PolicyId']
-
Disable-Mailbox Mailbox-disables the specified user account.
Disable-Mailbox -Identity 'Identifier' [-DomainController 'DCName']
-
Set-Mailbox Changes the specified properties of the specified mailbox.
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']
-
Get-Mailbox Retrieves a list of all or specific mailboxes.
Get-Mailbox [-Identity 'Identifier'] | [-Database 'DatabaseName'] [-DomainController 'DCName'] [-OrganizationalUnit 'OUName'] [-ResultSize 'Size'] [-SortBy 'Value']
-
Get-MailboxStatistics Retrieves summary statistics for all or specific mailboxes, as long as the mailboxes have been logged on to at least once.
Get-MailboxStatistics [-Identity 'Identifier'] [-Database 'MailboxDatabase'] [-Server 'Server']
Move-Mailbox Moves the mailbox of the specified user to the specified server.
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>]
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.
New-MailboxDatabase -Name 'MailboxDatabase' -StorageGroup 'StorageGroup' [-CopyEdbFilePath 'EdbFilePath'] [-DomainController 'DCName'] [-EdbFilePath 'EdbFilePath'] [-HasLocalCopy <$false|$true>] [-OfflineAddressBook 'OABId'] [-PublicFolderDatabase 'DatabaseId']
-
Remove-MailboxDatabase Removes the specified mailbox database.
Remove-MailboxDatabase -Identity 'MailboxDatabase' [-DomainController 'DCName']
-
Set-MailboxDatabase Sets the specified properties of the specified mailbox database.
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>]
-
Get-MailboxDatabase Retrieves a list of all or specified mailbox databases.
Get-MailboxDatabase [-Identity 'MailboxDatabase'] [-DomainController 'DCName'] Get-MailboxDatabase [-StorageGroup 'StorageGroup'] [-DomainController 'DCName'] Get-MailboxDatabase [-Server 'Server'] [-DomainController 'DCName']
-
Mount-Database Mounts the specified mailbox database.
Mount-Database -Identity 'MailboxDatabase' [-DomainController 'DCName'] [-Force <$false|$true>]
-
Dismount-Database Dismounts the specified mailbox database.
Dismount-Database -Identity 'MailboxDatabase' [-DomainController 'DCName']
-
Enable-DatabaseCopy Enables local continuous backup for the specified mail-box database.
Enable-DatabaseCopy -Identity 'MailboxDatabase' [-CopyEdbFilePath 'EdbFilePath'] [-DomainController 'DCName']
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.
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>]
-
Get-StorageGroup Retrieves a list of all or specified storage groups.
Get-StorageGroup [-Identity 'StorageGroup'] [-DomainController 'DCName']
-
Set-StorageGroup Changes the name of the specified storage group to the name value provided.
Set-StorageGroup -Identity 'StorageGroup' [-CircularLoggingEnabled <$false|$true>] [-DomainController 'DCName'] [-Name 'Name'] [-ZeroDatabasePages <$false|$true>]
-
Remove-StorageGroup Deletes the specified storage group.
Remove-StorageGroup -Identity 'StorageGroup' [-DomainController 'DCName']
-
Enable-StorageGroupCopy Enables local continuous backup for the specified storage group, provided all databases within the storage group already have this feature enabled.
Enable-StorageGroupCopy -Identity 'StorageGroup' [-CopyLogFolderPath 'LocalPath'] [-CopySystemFolderPath 'LocalPath'] [-DomainController 'DCName'] [-SeedingPostponed: <$false|$true>]
-
Disable-StorageGroupCopy Disables the continuous backup of the specified storage group.
Disable-StorageGroupCopy -Identity 'StorageGroup' [-DomainController 'DCName']
Категории