1

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.

4 Answers 4

1

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:

HKLM:\SOFTWARE\Microsoft\PowerShell\1\PowerShellSnapIns\Microsoft.Exchange.Management.PowerShell.Admin

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

0

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.

0

get-excommand

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

(get-excommand).count

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."

Anapologetos

Source

0

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .