Enabling Exchange Cmdlets in Powershell
In order to run Exchange Server commands within a Powershell script, the relevant cmdlets need to be ‚called‘ within Powershell.
This is accomplished with the following line, which is found at the start of nearly all of my Powershell scripts.
#Enable Exchange cmdlets
add-pssnapin *exchange* -erroraction SilentlyContinue