View Single Post
Old 11-15-2007   #5 (permalink)
Marco Shaw [MVP]


 
 

Re: Powershell excution policy on server with Exchange 2007

RD wrote:
Quote:

> But doing that, setting policy to "RemoteSigned", wouldn't compromise the
> security? My basic question is how I would I run Exchange PS scripts in
> background, like from win32 service or as scheduled job. Here are the options
> I see but each has its drawbacks.
> - Set the execution policy to "RemoteSigned" before running the scripts and
> reset back to "restricted".
> - If I set the policy to "AllSigned", I can't run as win32 service because
> there will be a prompt.
>
> I was wondering is there a better way to run the PS scripts as win32 service
> without changing the default policy of powershell. Is creating new runspace
> or shell would help? I'm new to Powershell and looking for some ideas.
I'll read a bit on that in the next day or so. I wasn't aware Exchange
had a different default policy.

For starters, you shouldn't be considering running a PS script as a
service. PS isn't really useful/designed for that.

A scheduled job is a much better fit.

Marco


--
Microsoft MVP - Windows PowerShell
http://www.microsoft.com/mvp

PowerGadgets MVP
http://www.powergadgets.com/mvp

Blog:
http://marcoshaw.blogspot.com
My System SpecsSystem Spec