powershell from Win7 32bit to Exchange 2010
I'd like to have an easy way to import everything I need to manage Exchange 2010 from Win7 into powershell. I have executed: $s = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://exchangeserver/powershell Import-PSSession $s But I can't run get-excommand like I was able to in 2007 and on the Exchange server itself. I noticed when executing EMS on my Exchange server it does stuff with RemoteExchange.ps1. Is there a way I can put RemoteExchange.ps1 on my Win7 box to properly import everything including get-excommand?
November 5th, 2010 9:41am

Hiya, get-excommand is just a function in the startup script for the EMS. It doesn't do much at all except run get-command and filter the result. If you want something similar try: $s = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://exchangeserver/powershell $r = Import-PSSession $s Then Get-Command -Module $r.Name If you want the full function back, almost word for word the same as the original, do it like this: $s = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://exchangeserver/powershell $global:r = Import-PSSession $s function get-excommand{if($args[0] -eq $null){get-command -module $global:r.name}else{get-command $args[0] | where{$_.Module -ilike $global:r.name}}} Then get-excommand should work as it does on the Exchange server. SteveSteve Goodman Check out my Blog for more Exchange info or find me on Twitter
Free Windows Admin Tool Kit Click here and download it now
November 5th, 2010 6:07pm

I did the same thing just took me longer. After 'import-pssession' I'd do 'get-module -all' then copy/paste the tmp_blahblah into 'get-command -module'. I didn't realize Import-PSSession returned the "module". That's the difference between me and a programmer. It sure would have been nice of Microsoft to make a 32-bit version of the management tools. Seems a little silly they didn't IMO. Thanks btw, learned something new...
November 5th, 2010 11:41pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics