Executing Exchange Powershell cmdlets and Active directory cmdlets on a single PowerShell

Many times we will have requirement to execute Exchange Comlets and Active Directory(Active Roles) cmdlets on a singlewindow. As we cannot execute exchange cmdlets in  AD shell and vice versa. We have to add snap in to the powershell to execute both cmdlets on a single shell.

1. Need to make sure both Exchange managelent tools and Quest Active role management shell for active directory has been isntalled on the machine
2. Create C:\ExchangeAd.ps1 file with following lines in it

 Add-PSSnapin Quest.ActiveRoles.ADManagement
 Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin

3. Open Windows powershell and type C:\exchangead.ps1 to add snapin to the windowspowershell. You can execute both the commands on the single shell
4. Or you can Cretae a bat file which contain follwing line and place into your desktop. For Easy accability

       C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe -noexit -command C:\ExchangeAd.ps1

5. You can also execute Quest snapin into Exchange powershell or Exchange snapin into Activeroles shell to execute other commands on the same window.

One thought on “Executing Exchange Powershell cmdlets and Active directory cmdlets on a single PowerShell

  1. Hi Krishna,

    This Post was very helpfull and glad to see the information which i was looking for a long time. Please do post similar finding which can be helpfull like us.

Leave a comment