Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - Powershell excution policy on server with Exchange 2007

Reply
 
Old 11-14-2007   #1 (permalink)
RD


 
 

Powershell excution policy on server with Exchange 2007

The documents say that the default execution policy of Powershell is
"Restricted". But it appears to me that whey you install Exchange server
2007, the policy is changed to "RemoteSigned". Is that correct? If so, how
can I run Exchange PS1 scripts with default security policy of PS. Thanks.

My System SpecsSystem Spec
Old 11-14-2007   #2 (permalink)
Marco Shaw [MVP]


 
 

Re: Powershell excution policy on server with Exchange 2007

RD wrote:
Quote:

> The documents say that the default execution policy of Powershell is
> "Restricted". But it appears to me that whey you install Exchange server
> 2007, the policy is changed to "RemoteSigned". Is that correct? If so, how
> can I run Exchange PS1 scripts with default security policy of PS. Thanks.
The default execution policy is 'restricted'. With that policy, you
won't be able to run scripts at all.

You need to determine what your security policy for writing and running
scripts will get.

Check out:
get-executionpolicy
and
set-executionpolicy

To set the default PS policy:
PSH> set-executionpolicy restricted

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
Old 11-15-2007   #3 (permalink)
RD


 
 

Re: Powershell excution policy on server with Exchange 2007

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.

RD

"Marco Shaw [MVP]" wrote:
Quote:

> RD wrote:
Quote:

> > The documents say that the default execution policy of Powershell is
> > "Restricted". But it appears to me that whey you install Exchange server
> > 2007, the policy is changed to "RemoteSigned". Is that correct? If so, how
> > can I run Exchange PS1 scripts with default security policy of PS. Thanks.
>
> The default execution policy is 'restricted'. With that policy, you
> won't be able to run scripts at all.
>
> You need to determine what your security policy for writing and running
> scripts will get.
>
> Check out:
> get-executionpolicy
> and
> set-executionpolicy
>
> To set the default PS policy:
> PSH> set-executionpolicy restricted
>
> 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
Old 11-15-2007   #4 (permalink)
RD


 
 

Re: Powershell excution policy on server with Exchange 2007

http://blogs.technet.com/haroldwong/...-02-14-07.aspx

This Microsoft blog article states that the default execution policy of
Exchange Management shell is "RemoteSigned". I think that allow any 3rd party
scripts (using C:/Program Files/Microsoft/Exchange Server/bin/exshell.psc1
option) to run from win32 serivce.

"Marco Shaw [MVP]" wrote:
Quote:

> RD wrote:
Quote:

> > The documents say that the default execution policy of Powershell is
> > "Restricted". But it appears to me that whey you install Exchange server
> > 2007, the policy is changed to "RemoteSigned". Is that correct? If so, how
> > can I run Exchange PS1 scripts with default security policy of PS. Thanks.
>
> The default execution policy is 'restricted'. With that policy, you
> won't be able to run scripts at all.
>
> You need to determine what your security policy for writing and running
> scripts will get.
>
> Check out:
> get-executionpolicy
> and
> set-executionpolicy
>
> To set the default PS policy:
> PSH> set-executionpolicy restricted
>
> 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
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
Old 11-15-2007   #6 (permalink)
RD


 
 

Re: Powershell excution policy on server with Exchange 2007

Isn't that the only option to port existing Excahnge 2003 service application
using VB script and COM client program to port to Exchange 2007?


"Marco Shaw [MVP]" wrote:
Quote:

> 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
Old 11-15-2007   #7 (permalink)
Marco Shaw [MVP]


 
 

Re: Powershell excution policy on server with Exchange 2007

RD wrote:
Quote:

> Isn't that the only option to port existing Excahnge 2003 service application
> using VB script and COM client program to port to Exchange 2007?
I don't know that much about Exchange, so I'll have to do some research...

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
Old 11-16-2007   #8 (permalink)
RD


 
 

Re: Powershell excution policy on server with Exchange 2007

I'm in process of installing Exchange 2007. After I installed PowerShell 1.0
(KB926139) as part of prerequisite, I checked the execution policy through
cmdlet "Get-ExecutionPolicy" and it returns "Restricted". However there is no
value key named "ExecutionPolicy" under
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell". Strange!

"Marco Shaw [MVP]" wrote:
Quote:

> RD wrote:
Quote:

> > Isn't that the only option to port existing Excahnge 2003 service application
> > using VB script and COM client program to port to Exchange 2007?
>
> I don't know that much about Exchange, so I'll have to do some research...
>
> 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
Old 11-20-2007   #9 (permalink)
RD


 
 

Re: Powershell excution policy on server with Exchange 2007

I installed Exchange 2007 EE and now Execution policy is "RemoteSigned". The
registry value for it is also created and set to "RemoteSigned". I also
noticed that there a new log file created in EventViwer "PowerShell". Does
any one know how this works.

Thanks.

"RD" wrote:
Quote:

> I'm in process of installing Exchange 2007. After I installed PowerShell 1.0
> (KB926139) as part of prerequisite, I checked the execution policy through
> cmdlet "Get-ExecutionPolicy" and it returns "Restricted". However there is no
> value key named "ExecutionPolicy" under
> "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell". Strange!
>
> "Marco Shaw [MVP]" wrote:
>
Quote:

> > RD wrote:
Quote:

> > > Isn't that the only option to port existing Excahnge 2003 service application
> > > using VB script and COM client program to port to Exchange 2007?
> >
> > I don't know that much about Exchange, so I'll have to do some research...
> >
> > 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
Old 11-20-2007   #10 (permalink)
Lee Holmes [MSFT]


 
 

Re: Powershell excution policy on server with Exchange 2007

Hi RD,

I've put an explanation here:
http://www.leeholmes.com/blog/3rdPar...nPolicies.aspx

--
Lee Holmes [MSFT]
Windows PowerShell Development
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.


"RD" <RD@xxxxxx> wrote in message
news:A9CADFAB-E9B9-4E89-AFA5-556DBBD14D2E@xxxxxx
Quote:

> The documents say that the default execution policy of Powershell is
> "Restricted". But it appears to me that whey you install Exchange server
> 2007, the policy is changed to "RemoteSigned". Is that correct? If so, how
> can I run Exchange PS1 scripts with default security policy of PS. Thanks.
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Running powershell via exchange 2007 PowerShell
Exchange 2007 and PowerShell PowerShell
Exchange 2007 PowerShell.. PowerShell
Microsoft Releases Public Betas of Exchange Server 2007 and Forefront Security for Exchange Server Vista News
Microsoft Releases Public Betas of Exchange Server 2007 and Forefront Security for Exchange Server Vista News


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46