Looks pretty good, although on the new-pssession I'd leave off the -authentication Kerberos I don't think having it will cause any grief, but I don't use it on my Exchange remoting.
DAMIEN SOLODOW Senior Systems Engineer 317.447.6033 (office) 317.447.6014 (fax) HARRISON COLLEGE From: [email protected] [mailto:[email protected]] On Behalf Of David McSpadden Sent: Tuesday, October 27, 2015 8:23 AM To: [email protected] Subject: [NTSysADM] RE: Running a PS remotely I think this should do? $UserName = '[email protected]' $ClearTxtPassword = 'My Password' $SecurePassword = Convertto-SecureString -String $ClearTxtPassword -AsPlainText -force $UserCredential = New-Object System.Managment.Automation.PSCredential $UserName, $SecurePassword $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://FQDN/PowerShell/ -Authentication Kerberos -Credential $UserCredential Import-PSSession $Session .\Get-ActiveSyncReport.ps1 -exportpath c:\tmp -smtpserver 10.0.55.58 -smtpfrom [email protected]<mailto:[email protected]> -smtpto [email protected]<mailto:[email protected]> Remove-PSSession $Session This would allow me to run this from a remote server and get Exchange output with no pop up prompts?? From: [email protected]<mailto:[email protected]> [mailto:[email protected]] On Behalf Of Damien Solodow Sent: Monday, October 26, 2015 3:51 PM To: [email protected]<mailto:[email protected]> Subject: [NTSysADM] RE: Running a PS remotely If you have the Exchange Management Tools installed on your workstation, you should be able to do it via the Exchange Management Shell. Otherwise, implicit remoting is your friend. :) http://blogs.technet.com/b/heyscriptingguy/archive/2012/01/23/learn-how-to-use-powershell-to-run-exchange-server-commands-remotely.aspx DAMIEN SOLODOW Senior Systems Engineer 317.447.6033 (office) 317.447.6014 (fax) HARRISON COLLEGE From: [email protected]<mailto:[email protected]> [mailto:[email protected]] On Behalf Of David McSpadden Sent: Monday, October 26, 2015 3:42 PM To: [email protected]<mailto:[email protected]> Subject: [NTSysADM] Running a PS remotely I would like to run a Get-ActiveSyncReport from a remote machine other than the HUB or Mailbox server themselves. How do I remote kick of this direction? Thanks David This e-mail and any files transmitted with it are property of Indiana Members Credit Union, are confidential, and are intended solely for the use of the individual or entity to whom this e-mail is addressed. If you are not one of the named recipient(s) or otherwise have reason to believe that you have received this message in error, please notify the sender and delete this message immediately from your computer. Any other use, retention, dissemination, forwarding, printing, or copying of this email is strictly prohibited. Please consider the environment before printing this email. This e-mail and any files transmitted with it are property of Indiana Members Credit Union, are confidential, and are intended solely for the use of the individual or entity to whom this e-mail is addressed. If you are not one of the named recipient(s) or otherwise have reason to believe that you have received this message in error, please notify the sender and delete this message immediately from your computer. Any other use, retention, dissemination, forwarding, printing, or copying of this email is strictly prohibited. Please consider the environment before printing this email.
