Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When you perform certain operations in the Exchange Management Console GUI a window appears showing the PowerShell command that was executed to perform the operation. This is useful for learning how to create a PowerShell script to do the same thing.

Is there a way to get the PowerShell commands that execute for minor operations in Exchange like when just changing various attirbutes in a property dialog?

From some of the answers I can tell my question is not clear. I am referring to the Exchange Management Console which has a GUI not the PowerShell based Exchange Management Shell. In the Console, when you perform operations that use a wizard like adding new users, the final dialog show a text box with the PowerShell command that was executed in the background. I am wondering if it is possible to get those commands when performing minor operation in the GUI.

share|improve this question
up vote 1 down vote accepted

The Exchange Management Shell will log all of the PowerShell commands it executes if you set a registry key that enables logging. The commands will be logged to the Event Viewer in the PowerShell folder.

The key can be set by navigating to:


using Regedit and creating a string value named LogpipelineExecutionDetails with a value of "1".

This registry value can also be created using the following PowerShell command:

Set-ItemProperty HKLM:\SOFTWARE\Microsoft\PowerShell\1\PowerShellSnapIns\Microsoft.Exchange.Management.PowerShell.Admin -Name LogpipelineExecutionDetails -value 1

share|improve this answer

You can run the get-member command on any item in Powershell, to get all the properties and operations for the object, for example the command below will show you all the attributes, properties and operations available on a mailbox:

get-mailbox bob | get-member

You can get a list of all Exchange Powershell commands on Technet.

share|improve this answer


you will see information on 368 cmdlets. You can confirm that using the command:


To add some focus to your search for relevant Exchange commands use wildcards with the get-command cmdlet. For example, to find cmdlets relevant to POP3 configuration type

*get-command *pop**

which returns information on any cmdlet whose name includes the character sequence pop. The relevant commands are displayed."



share|improve this answer

You may want to use the "set-user" command. An example from a script I have:

set-user -Identity "CN=$displayName,CN=Users,DC=contoso,DC=edu" -City $City -Department "$department"-Office $office -Phone "$phone" -StreetAddress "$POBox`r`n$Office`r`n$Department" -StateOrProvince $State -PostalCode $ZipCode
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.