• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Moving objects between different versions of Powershell

imagoon

Diamond Member
Just wanted to put this out there since it took me forever to find a solution.

Case: Running server 2012R2 with AD modules installed and Exchange server 2010 management tools. This might affect 2013 as well.

If you start an Exchange Management Shell and try to import-module activedirectory, you will be greeted with a pile error messages because EMS runs in Powershell 3 and 2012R2 AD modules require Powershell 4. Vis versa applies also. Exchange horks up about 98 pages of errors when trying to load the snapin inside powershell 4.

The trick I found was that you can run powershell directly and use -outputformat XML to pass the object to the pipe or a variable.

IE
--Inside Exchange 2010 Management Shell-- (semi paraphrased)

$adusers=(powershell -command {get-aduser -properties HomeMTA | where {$_.homemta -like "OU=Terminated*"}} -outputformat XML)

or

(powershell -command {get-aduser -properties HomeMTA | where {$_.homemta -like "OU=Terminated*"}} -outputformat XML)| foreach {new-moverequest -identity $_.distinguishedname -targetdatabase Archive}

"the more you know."

Hope it helps someone.
 
Back
Top