Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

Set-ExecutionPolicy Unrestricted

Closed Thread
 
Thread Tools Display Modes
Old 05-04-2007   #1 (permalink)
Stefan Koell
Guest


 

Set-ExecutionPolicy Unrestricted

Hi,

I want to start ps1 scripts over UNC paths or mapped network shares. I tried
to change the execution policy to unrestricted but I always get the
following prompt:

Security Warning
Run only scripts that you trust. While scripts from the Internet can be
useful, this script can potentially harm your
computer. Do you want to run \\blablabla\bla?
[D] Do not run [R] Run once [S] Suspend [?] Help (default is "D"):

This is bad! In my case these scripts are executed by scheduled tasks or
other management tools remotely so that the user input is no option.

Here my questions:
* Can I disable this prompt? If so, all is good again - but I fear it's not
that simple?!
* Can I somehow specify a trusted location (like caspol.exe offers in the
dotnet framework)?
* Do I have to sign all my scripts?
* Do I have to buy a certificate to sign my scripts?
* I have no CA installed in our domain, can I do codesigning - ie creating
certificates somehow - using standard active directory functionality without
having a CA installed?
* Is there a "good" documentation about signing? I read a lot about
self-signing scripts but this is in our environment not very practicable
(deployment of certificates for all sorts of users accounts). What do I have
to do if I get some of these codesigning certificates?

Please, can someone help me out here?

Thanks in advance

Stefan

Old 05-04-2007   #2 (permalink)
Marco Shaw
Guest


 

Re: Set-ExecutionPolicy Unrestricted

Stefan Koell wrote:
> Hi,
>
> I want to start ps1 scripts over UNC paths or mapped network shares. I
> tried to change the execution policy to unrestricted but I always get
> the following prompt:
>
> Security Warning
> Run only scripts that you trust. While scripts from the Internet can be
> useful, this script can potentially harm your
> computer. Do you want to run \\blablabla\bla?
> [D] Do not run [R] Run once [S] Suspend [?] Help (default is "D"):
>
> This is bad! In my case these scripts are executed by scheduled tasks or
> other management tools remotely so that the user input is no option.
>
> Here my questions:
> * Can I disable this prompt? If so, all is good again - but I fear it's
> not that simple?!
> * Can I somehow specify a trusted location (like caspol.exe offers in
> the dotnet framework)?
> * Do I have to sign all my scripts?
> * Do I have to buy a certificate to sign my scripts?
> * I have no CA installed in our domain, can I do codesigning - ie
> creating certificates somehow - using standard active directory
> functionality without having a CA installed?
> * Is there a "good" documentation about signing? I read a lot about
> self-signing scripts but this is in our environment not very practicable
> (deployment of certificates for all sorts of users accounts). What do I
> have to do if I get some of these codesigning certificates?
>
> Please, can someone help me out here?
>
> Thanks in advance
>
> Stefan


Try running 'set-psdebug -off'. Assuming that is OK...

Marco
Old 05-04-2007   #3 (permalink)
Stefan Koell
Guest


 

Re: Set-ExecutionPolicy Unrestricted

Thanks for your suggestion, unfortunately it doesn't work. I turned it off
but as soon as I tried to dot source a ps1 script with an UNC I immediately
get the prompt again.

Any other suggestions?

"Marco Shaw" <marco.shaw@_NO_SPAM_gmail.com> wrote in message
news:e7Q1S9mjHHA.460@TK2MSFTNGP05.phx.gbl...
> Stefan Koell wrote:
>> Hi,
>>
>> I want to start ps1 scripts over UNC paths or mapped network shares. I
>> tried to change the execution policy to unrestricted but I always get the
>> following prompt:
>>
>> Security Warning
>> Run only scripts that you trust. While scripts from the Internet can be
>> useful, this script can potentially harm your
>> computer. Do you want to run \\blablabla\bla?
>> [D] Do not run [R] Run once [S] Suspend [?] Help (default is "D"):
>>
>> This is bad! In my case these scripts are executed by scheduled tasks or
>> other management tools remotely so that the user input is no option.
>>
>> Here my questions:
>> * Can I disable this prompt? If so, all is good again - but I fear it's
>> not that simple?!
>> * Can I somehow specify a trusted location (like caspol.exe offers in the
>> dotnet framework)?
>> * Do I have to sign all my scripts?
>> * Do I have to buy a certificate to sign my scripts?
>> * I have no CA installed in our domain, can I do codesigning - ie
>> creating certificates somehow - using standard active directory
>> functionality without having a CA installed?
>> * Is there a "good" documentation about signing? I read a lot about
>> self-signing scripts but this is in our environment not very practicable
>> (deployment of certificates for all sorts of users accounts). What do I
>> have to do if I get some of these codesigning certificates?
>>
>> Please, can someone help me out here?
>>
>> Thanks in advance
>>
>> Stefan

>
> Try running 'set-psdebug -off'. Assuming that is OK...
>
> Marco


Old 05-04-2007   #4 (permalink)
Marco Shaw
Guest


 

Re: Set-ExecutionPolicy Unrestricted

Stefan Koell wrote:
> Thanks for your suggestion, unfortunately it doesn't work. I turned it
> off but as soon as I tried to dot source a ps1 script with an UNC I
> immediately get the prompt again.
>
> Any other suggestions?


Is set-psdebug set in the script or any scripts it calls?
Old 05-04-2007   #5 (permalink)
Brandon Shell
Guest


 

Re: Set-ExecutionPolicy Unrestricted

If you check in IE -> Internet Options -> Security - Local Intranet.
Make sure all the check boxes are checked.

If the check box is not check UNC paths are consider Internet Zone and not
Intranet.

p.s. Not sure why Unrestricted still checks, but This could fix it.

"Stefan Koell" <stefan_koell@hotmail.com> wrote in message
news:OtFKTDnjHHA.2552@TK2MSFTNGP06.phx.gbl...
> Thanks for your suggestion, unfortunately it doesn't work. I turned it off
> but as soon as I tried to dot source a ps1 script with an UNC I
> immediately get the prompt again.
>
> Any other suggestions?
>
> "Marco Shaw" <marco.shaw@_NO_SPAM_gmail.com> wrote in message
> news:e7Q1S9mjHHA.460@TK2MSFTNGP05.phx.gbl...
>> Stefan Koell wrote:
>>> Hi,
>>>
>>> I want to start ps1 scripts over UNC paths or mapped network shares. I
>>> tried to change the execution policy to unrestricted but I always get
>>> the following prompt:
>>>
>>> Security Warning
>>> Run only scripts that you trust. While scripts from the Internet can be
>>> useful, this script can potentially harm your
>>> computer. Do you want to run \\blablabla\bla?
>>> [D] Do not run [R] Run once [S] Suspend [?] Help (default is "D"):
>>>
>>> This is bad! In my case these scripts are executed by scheduled tasks or
>>> other management tools remotely so that the user input is no option.
>>>
>>> Here my questions:
>>> * Can I disable this prompt? If so, all is good again - but I fear it's
>>> not that simple?!
>>> * Can I somehow specify a trusted location (like caspol.exe offers in
>>> the dotnet framework)?
>>> * Do I have to sign all my scripts?
>>> * Do I have to buy a certificate to sign my scripts?
>>> * I have no CA installed in our domain, can I do codesigning - ie
>>> creating certificates somehow - using standard active directory
>>> functionality without having a CA installed?
>>> * Is there a "good" documentation about signing? I read a lot about
>>> self-signing scripts but this is in our environment not very practicable
>>> (deployment of certificates for all sorts of users accounts). What do I
>>> have to do if I get some of these codesigning certificates?
>>>
>>> Please, can someone help me out here?
>>>
>>> Thanks in advance
>>>
>>> Stefan

>>
>> Try running 'set-psdebug -off'. Assuming that is OK...
>>
>> Marco

>


Old 05-04-2007   #6 (permalink)
Stefan Koell
Guest


 

Re: Set-ExecutionPolicy Unrestricted

Basically I do the following:
I fire up a command shell
I type Set-PSDebug -off
Then I type (without the surrounding quotes) ".
\\someserver\someshare\sompath\some.ps1"
where the some.ps1 just contains a write-host "Hello World"

and then I get the security warning.

Any ideas? Am I doing something wrong? I have to admit I am still a PS
newbie...

"Marco Shaw" <marco.shaw@_NO_SPAM_gmail.com> wrote in message
news:e7i$eHnjHHA.2440@TK2MSFTNGP06.phx.gbl...
> Stefan Koell wrote:
>> Thanks for your suggestion, unfortunately it doesn't work. I turned it
>> off but as soon as I tried to dot source a ps1 script with an UNC I
>> immediately get the prompt again.
>>
>> Any other suggestions?

>
> Is set-psdebug set in the script or any scripts it calls?


Old 05-04-2007   #7 (permalink)
Stefan Koell
Guest


 

Re: Set-ExecutionPolicy Unrestricted

Hi,

I did check the Local Intranet settings as you suggested and there are all 3
checkboxes checked (including the one with the UNCs).

Are you saying, that setting it the execution policy to unrestricted
shouldn't prompt for confirmation, never?

Thanks

"Brandon Shell" <tshell.mask@gmail.com> wrote in message
news:ODURWLnjHHA.4040@TK2MSFTNGP03.phx.gbl...
> If you check in IE -> Internet Options -> Security - Local Intranet.
> Make sure all the check boxes are checked.
>
> If the check box is not check UNC paths are consider Internet Zone and not
> Intranet.
>
> p.s. Not sure why Unrestricted still checks, but This could fix it.
>
> "Stefan Koell" <stefan_koell@hotmail.com> wrote in message
> news:OtFKTDnjHHA.2552@TK2MSFTNGP06.phx.gbl...
>> Thanks for your suggestion, unfortunately it doesn't work. I turned it
>> off but as soon as I tried to dot source a ps1 script with an UNC I
>> immediately get the prompt again.
>>
>> Any other suggestions?
>>
>> "Marco Shaw" <marco.shaw@_NO_SPAM_gmail.com> wrote in message
>> news:e7Q1S9mjHHA.460@TK2MSFTNGP05.phx.gbl...
>>> Stefan Koell wrote:
>>>> Hi,
>>>>
>>>> I want to start ps1 scripts over UNC paths or mapped network shares. I
>>>> tried to change the execution policy to unrestricted but I always get
>>>> the following prompt:
>>>>
>>>> Security Warning
>>>> Run only scripts that you trust. While scripts from the Internet can be
>>>> useful, this script can potentially harm your
>>>> computer. Do you want to run \\blablabla\bla?
>>>> [D] Do not run [R] Run once [S] Suspend [?] Help (default is "D"):
>>>>
>>>> This is bad! In my case these scripts are executed by scheduled tasks
>>>> or other management tools remotely so that the user input is no option.
>>>>
>>>> Here my questions:
>>>> * Can I disable this prompt? If so, all is good again - but I fear it's
>>>> not that simple?!
>>>> * Can I somehow specify a trusted location (like caspol.exe offers in
>>>> the dotnet framework)?
>>>> * Do I have to sign all my scripts?
>>>> * Do I have to buy a certificate to sign my scripts?
>>>> * I have no CA installed in our domain, can I do codesigning - ie
>>>> creating certificates somehow - using standard active directory
>>>> functionality without having a CA installed?
>>>> * Is there a "good" documentation about signing? I read a lot about
>>>> self-signing scripts but this is in our environment not very
>>>> practicable (deployment of certificates for all sorts of users
>>>> accounts). What do I have to do if I get some of these codesigning
>>>> certificates?
>>>>
>>>> Please, can someone help me out here?
>>>>
>>>> Thanks in advance
>>>>
>>>> Stefan
>>>
>>> Try running 'set-psdebug -off'. Assuming that is OK...
>>>
>>> Marco

>>

>


Old 05-04-2007   #8 (permalink)
Marco Shaw
Guest


 

Re: Set-ExecutionPolicy Unrestricted

Brandon Shell wrote:
> If you check in IE -> Internet Options -> Security - Local Intranet.
> Make sure all the check boxes are checked.
>
> If the check box is not check UNC paths are consider Internet Zone and
> not Intranet.
>
> p.s. Not sure why Unrestricted still checks, but This could fix it.


I'm suprised... How does the IE zone settings affect how PowerShell runs
its own scripts?! This documented somewhere?

Marco
Old 05-04-2007   #9 (permalink)
Brandon Shell
Guest


 

Re: Set-ExecutionPolicy Unrestricted

Its not really powershell... its the machine as a whole. AFAICT anything
that references ZONEs uses IE zones (registry to be more specific)

Can you right click the file and see if it is blocked? (Vista/Longhorn) or
you can Look at the ADS of the file.

"Marco Shaw" <marco.shaw@_NO_SPAM_gmail.com> wrote in message
news:e95TPRnjHHA.3708@TK2MSFTNGP04.phx.gbl...
> Brandon Shell wrote:
>> If you check in IE -> Internet Options -> Security - Local Intranet.
>> Make sure all the check boxes are checked.
>>
>> If the check box is not check UNC paths are consider Internet Zone and
>> not Intranet.
>>
>> p.s. Not sure why Unrestricted still checks, but This could fix it.

>
> I'm suprised... How does the IE zone settings affect how PowerShell runs
> its own scripts?! This documented somewhere?
>
> Marco


Old 05-04-2007   #10 (permalink)
Marco Shaw
Guest


 

Re: Set-ExecutionPolicy Unrestricted


> Then I type (without the surrounding quotes) ".
> \\someserver\someshare\sompath\some.ps1"
> where the some.ps1 just contains a write-host "Hello World"
>
> and then I get the security warning.
>
> Any ideas? Am I doing something wrong? I have to admit I am still a PS
> newbie...
>


The thing is, that remote some.ps1 script could then turn back on
'set-psdebug -step' in its first line, then possibly turn it back off in
its last line...

Try 'get-content \\someserver\someshare\sompath\some.ps1' to see if you
can read the script.
Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Set-ExecutionPolicy in RunOnce doesn't work ssg31415926 PowerShell 3 05-16-2008 11:49 AM
Vista Guest Account Has Unrestricted Access to the Registry? musicmanrdu System Security 9 04-24-2008 10:55 PM
Prompted to RUN ONCE or SUSPEND when Unrestricted is already set??? Susan P. PowerShell 9 01-29-2008 02:06 PM
set-executionpolicy BinaryCoder PowerShell 4 11-30-2007 05:59 PM
Bypassing Security Prompt in Unrestricted Mode greatbarrier86 PowerShell 7 08-14-2007 02:32 PM








Vistax64.com 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 2005-2008

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 47 48 49 50