Determine which cmdlets are available to Exchange Online administrators with Office 365 PowerShell

 

上次修改主題的時間:2016-07-28

Summary: Use Office 365 PowerShell to figure out which cmdlets are available to Microsoft Exchange Online administrators.

Help topics for all the cmdlets available to Microsoft Exchange Online administrators can be found in two different places. First, there are about 40 or so cmdlets that can be used only with Microsoft Exchange Online. This set of cmdlets will not work with the on-premises version of Exchange Server. Those cmdlets are documented here.

However, the vast majority of the cmdlets available to Microsoft Exchange Online administrators can also be used with the on-premises version of Exchange Server. All of those cmdlets can be found here. How do you know which of these cmdlets can be used with Microsoft Exchange Online and which ones can’t? One way is to take a look at the documentation for a given cmdlet. Here is an example of an article that documents the Disable-Mailbox cmdlet:

Disable-Mailbox Exchange 指令程式文章和 [套用到] 欄位的範例。

If Microsoft Exchange Online is in the Applies to list, the cmdlet applies to Microsoft Exchange Online.

Another way is to list the cmdlets after connecting to Microsoft Exchange Online.

Before you get started using Office 365 PowerShell to manage Microsoft Exchange Online, make sure that you have connected to Microsoft Exchange Online PowerShell. For more information, see Connect to Exchange Online PowerShell.

After connecting to Microsoft Exchange Online, you can list the cmdlets available to you with these commands:

$mods=Get-Module | where {$_.Name -like "tmp_*"}; $modName=$mods.Name
Get-Command -Module $modName | More

Note that these commands first obtain the name of the module for the Microsoft Exchange Online cmdlets, which changes every time you connect to Microsoft Exchange Online, and then displays the commands one page at a time. To stop paging through screen after screen of cmdlet names, just press Ctrl-C to exit.

If you’re just interested in a certain subset of cmdlets (say, all the cmdlets for disabling things) you can use the wildcard character (*) to filter cmdlets based on the cmdlet name. For example, this command returns only the Microsoft Exchange Online cmdlets that start with the word Disable:

Get-Command -Name "Disable*" -Module $modName 

This command displays something similar to the following (your ModuleName will be different):

CommandType     Name                             ModuleName
-----------     ----                             ----------
Function        Disable-App                      tmp_lqy0pg2k.aij
Function        Disable-HostedContentFilterRule  tmp_lqy0pg2k.aij
Function        Disable-InboxRule                tmp_lqy0pg2k.aij
Function        Disable-JournalRule              tmp_lqy0pg2k.aij
Function        Disable-Mailbox                  tmp_lqy0pg2k.aij
Function        Disable-MailPublicFolder         tmp_lqy0pg2k.aij
Function        Disable-MalwareFilterRule        tmp_lqy0pg2k.aij
Function        Disable-OutlookProtectionRule    tmp_lqy0pg2k.aij
Function        Disable-TransportRule            tmp_lqy0pg2k.aij
Function        Disable-UMAutoAttendant          tmp_lqy0pg2k.aij
Function        Disable-UMCallAnsweringRule      tmp_lqy0pg2k.aij
Function        Disable-UMIPGateway              tmp_lqy0pg2k.aij
Function        Disable-UMMailbox                tmp_lqy0pg2k.aij

As another example, this command returns only those cmdlets that include the word Junk somewhere in the cmdlet name:

Get-Command -Name "*Junk*" -Module $modName 

This command returns something similar to the following:

CommandType     Name                               ModuleName
-----------     ----                               ----------
Function        Get-MailboxJunkEmailConfiguration  tmp_lqy0pg2k.aij
Function        Set-MailboxJunkEmailConfiguration  tmp_lqy0pg2k.aij
 
顯示: