Some important Exchange Server 2010 Shell Commands
Though we feel comfortable to use graphical interface to configure Exchange server 2010, we can also use shell commands to apply the configuration to get quick response. In order to configure Exchange 2010 with shell commands, we need to use EMS (Exchange Management Shell). All commands associated in EMS are called Cmdlet.
Generally EMS has some common verbs for Cmdlet action which are New, Get, Set, Enable, Disable and Remove. All these verbs work with some parameters.
Here are some useful shell commands and their description to perform Exchange management.
1. Invoke – item
This command uses in order to open a file as double-click does. If you want to open a file, named Textfile.txt from your desktop then the code is like below
Example: Invoke-Item C:UsersUser_NmeDesktopTextfile.txt
2. New – Mailbox
This command uses to create a new user in Active Directory along with mailbox. This command consist of some mandatory and optional parameters like below
But here we can use the command only supplying these parameters – “Name, Password, User Principal Name, Organizational Unit, First Name, Last Name, Database and Alias”.
Example: New-Mailbox -UserPrincipalName [email protected]omain.com -Alias Russel -Name RusselCrow -OrganizationalUnit ExampleUnit -Password Some9Pwd -FirstName Russel -LastName Crow -DisplayName “RusselCrow”
3. New – Distribution Group
In order to create a group in your organization this command is used.
Example: New-DistributionGroup -Name “Marketing” -OrganizationalUnit “somedomain.com/users” -SAMAccountName “Marketing” -Type “Distribution”
4. Add – Distribution Group Member
Use this command to add a user in a distribution group.
DistributionGroupMember -Identity “Marketing” -Member “Russel Crow”
5. New – Mail Contact
This command allows user to create a new contact of an external address
Example: New-Mailcontact -Name James bond` -ExternalEmailAddress: [email protected] Admin` -Alias JamesBond
6. Enable – Mail Contact
Use this command to enable a contact.
Example: Enable-MailContact -Identity JamesBond -ExternalEmailAddress “jamesbo[email protected]”
7. Disable – Mail Contact
This command allows user to make disable the contact
Example: Disable-MailcontactJames Bond
8. Remove – Mail Contact
This command is used to remove the mail contact from active directory.
Example: Remove-MailContact -Identity ‘somedomain.com/Users/jamesbond’
9. Get – Mailbox
This command is used to check mailbox information.
Example: Get-Mailbox -Identity JamesBond
Also, there is other more Cmdlet for Exchange 2010 and we can find out those with the help command below.
10. Get – Help
This command is used to get help about any command. It will show the command which you are seeking with its full parameter.
Example: Get-Help New –full
Here it will display all information regarding New, which means all command associated with New verb is shown. You can also pick any of the displayed command with a Get-Help command, and it will show all information with parameter.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = == = = = = = = = = = = = = = = = = = = = = = = = = = = = = =