powershell - Trouble with Remote Sessions and Exchange 2007 Servers -


anyway, i'm working on powershell scripts work, , i'm stuck on thought simple. basically, there tasks need perform on our exchange server great script. spent time writing script connect me our server (on same domain), , run invoke-command few test commands. once test commands running, can start writing meat of script.

for however, i'm stuck getting get-mailbox return information, me trying test things working. see 3 lines of test code here:

$mainsession = new-pssession -computername theservername  invoke-command -session $mainsession -scriptblock {add-pssnapin microsoft.exchange.management.powershell.admin}  invoke-command -session $mainsession -scriptblock {get-mailbox} 

i "psremotingtransportexception" exception "job_failure" error. be? know snap-in , get-mailbox commands work when log-in server via remote-desktop , test them out. assuming can get-mailbox function, perform more complicated tasks want put in script. exchange server i'm connecting pretty old (2007?), it's not i'm using wrong snap-in. missing credentials? right it's not asking me any, tried adding -credential flag , didn't either.

i'm super new powershell, appreciated. here exact error, apologies crap formatting:

processing data remote command failed following error message: wsman provider     host process did not return proper response. provider in host process may have behaved improperly. more information, see about_remote_troubleshooting topic. + categoryinfo : operationstopped: (system.manageme...pressionsyncjob:psinvokeexpressionsyncjob) [], psremotingtransportexception + fullyqualifiederrorid : jobfailure 

i should mention tried increasing shell mb size via set-item wsman:\localhost\shell\maxmemorypershellmb 1024 -force. best guess has -credential flag far haven't had success it.

official support remote exchange administration powershell added in exchange 2010, believe.

it seems @ least 1 person has found way make work exchange 2007.

sorry link-only answer, solution seems pretty involved, using impersonation, special user account created purpose, script modules have installed on exchange server, etc.

given solution, wonder if make work more using powershell endpoint running exchange administrator. cleaner mess. create endpoint, set runasuser, , use startupscript add snapin. can't if work though , have no access exchange 2007 environment test it.


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -