Determining Which Cmdlets are Available to Exchange Online Administrators

 

Summary: Use Windows PowerShell to Manage Office 365 using Windows PowerShell cmdlets, scripts, and batch processes.

Help topics for all the cmdlets available to Exchange Online administrators can be found in two different places. First, there are about 40 or so cmdlets that can be used only with Exchange Online; this set of cmdlets will not work with the on-premises version of Exchange Server. Those cmdlets are documented here. (While, you’re there, you might also take a look at the article Connect to Exchange Online using Remote PowerShell.)

However, the vast majority of the cmdlets available to 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 Exchange Online and which ones can’t? One way is to take a look at the documentation for a given cmdlet:

Applies To box for Exchange cmdlets.

If the documentation says the cmdlet applies to Exchange Online, well, then the cmdlet applies to Exchange Online.

Alternatively, after you’ve used Windows PowerShell to connect to Exchange Online you can easily retrieve a list of the cmdlets available to you. To do that, first run the command Get-Module to return a list of all the modules currently loaded in your instance of Windows PowerShell. That’s going to return information similar to this:

ModuleType  Version  Name             ExportedCommands
----------  ------- ----              ----------------
Manifest    1.0      MSOnline         {Add-MsolForeignGroupToRol...
Script      1.0      tmp_lqy0pg2k.aij {Add-AvailabilityAddressSpace...

In this example, the module tmp_lqy0qypg2k.aij is the Exchange Online module. Note that the module name will change each time you connect to Exchange Online; that’s because the module is not installed locally on your computer, but is dynamically generated each time you connect to Exchange Online. Fortunately, you can simply look at the list of exported commands to determine which of these temporary modules is for Exchange Online: at the moment, at least, the first cmdlet listed for Exchange Online will be Add-AvailabilityAddressSpace.

Once you know the module name you can then use a command like this to return a list of all the Exchange Online cmdlets:

Get-Command -Module "tmp_lqy0pg2k.aij"     

Note

How are you supposed to remember a module name like tmp_lqy0pg2k.aij? Well, fortunately you don’t have to. If you look at the list of available modules, the Exchange Online module is the only one that starts with the letter t. Therefore, type this and the press the TAB key:
Get-Command –Module t
Give it a try and see what happens.

Incidentally, the 492 Exchange Online cmdlets will zip past you in a huge scrolling list that might make your head spin. If you’d like to take things a little slower, and maybe look at one screen’s worth of cmdlets at a time, use this command instead:

Get-Command -Module "tmp_lqy0pg2k.aij" | More    

That command will show you one screen’s worth of cmdlets, then pause until you press a key on the keyboard. At that point, it will show you the second screen’s worth. If you get tired of 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 Exchange Online cmdlets that start with the word Disable:

Get-Command -Name "Disable*" -Module "tmp_lqy0pg2k.aij" 

That should give you back the following:

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

And this command returns only those cmdlets that include the word Junk somewhere in the cmdlet name:

Get-Command -Name "*Junk*" -Module "tmp_lqy0pg2k.aij" 

In other words:

CommandType     Name                               ModuleName
-----------     ----                               ----------
Function        Get-MailboxJunkEmailConfiguration  tmp_lqy0pg2k.aij
Function        Set-MailboxJunkEmailConfiguration  tmp_lqy0pg2k.aij

Needless to say, tricks like that can be very handy when you’re dealing with all these cmdlets.

See Also

Using Windows PowerShell to Manage Exchange Online