Right click on script"run with PowerShell"

I have set the execution policy in GPO to remoteSigned, and it is working fine, when I run the script from cmd prompt powershell –f
When I right click the script and choose “run with PowerShell” it starts with this text in red
Set-ExecutionPolicy : Windows PowerShell updated your execution policy successfully, but the setting is overridden by a policy defined at a more specific scope. 
Due to the override, your shell will retain its current effective executionpolicy of RemoteSigned
The script is working, but it do not look right for a user of the script.
Sometimes when I run the script “run with PowerShell” it prompts the user to overwrite policy, again no matter if I choose yes or no, the script will run.
I am running on Windows 8.1 Update 1 x64, Powershell 4.0
Do anyone know how to fix?
Kind Regards
Jens
Jens Lund

There is another Group Policy setting that is setting a different policy. Post in the GP forum to get help with fixing this.
Possibility #2.  You are setting the policy in your profile or on the command line.
¯\_(ツ)_/¯

Similar Messages

  • Powershell script run with TaskScheduler not stopping VM's

    I have a script that stops and starts the VM's, and copies files and it works ok when I run it with powershell, but when I run it with TaskScheduler, it's not stopping/starting the VM's (but does copy files).  We have server 2008 R2.  I updated
    powershell to version 3 and downloaded and installed the Hypver-V powershell module from Microsoft.
    Also, when I run the script through powershell, I needed to run as administrator.  When I run it with the powershell prompt this is what it looks like:
    C:\windows\system32> powershell -NoProfile -noninteractive -ExecutionPolicy bypass -Command "& c:\Scripts\BackupVhdShell_2_param.ps1 -single_backup_file_to_loc 'E:\' -single_backup_file_from_loc 'S:\SQL-bak.vhd'"
    So that works from powreshell to start/stop vm's and copy files.
    In Task Scheduler, this is how I have it set up:
    Run with highest priviledges is checked. I have my login credentials saved so it can wake up the server when I'm not here or if it's not up.  
    In The Program/script field: %SystemRoot%\SysWow64\WindowsPowerShell\v1.0\powershell.exe
    In the Add Arguments field: -NoProfile -noninteractive -ExecutionPolicy bypass -Command "& c:\Scripts\BackupVhdShell_2_param.ps1 -single_backup_file_to_loc 'E:\' -single_backup_file_from_loc 'S:\SQL-bak.vhd'"
    Any thoughts?  I'm not sure if TaskManager isn't finding HyperV module?
    This is what the majority of the script looks like:
    param($single_backup_file_to_loc, $single_backup_file_from_loc)
    function StopVMsInOrder ([array][String]$vmNames){ 
    #this function will stop VM's in list, sequentially 
       Write-Host "Processing virtual machines in order"
       foreach ($name in $vmNames) {
           Write-Host "Analyzing $name"
           Try {
                 #Write-Host "...Saving $name"
                 #Save-VM -VM $name -wait -Force
                 Write-Host "..shutdown $name" #name)"
                 Invoke-VMShutdown -VM $name -Force #$vm.name
           } #try
           Catch {
              Write-Host "Failed to get virtual machine $name"
           } #catch
       }#foreach
    } #function StopVMsInOrder
    function StartVMsInOrder ([array][String]$vmNames){ 
    #this function will start VM's in list, sequentially as opposed to all at once
       Write-Host "Processing virtual machines in order"
       foreach ($name in $vmNames) {
           Write-Host "Analyzing $name"
           Try {
                 Write-Host "..Starting $name"
                 Start-VM -VM $name -wait
           } #try
           Catch {
              Write-Host "Failed to get virtual machine $name"
           } #catch
       }#foreach
    } #function StartVMsInOrder
    function CopyFileToFolder ([string]$Source,[string]$destination){  
       # get filename  
    #################start of script##############
    import-module Hyperv
    #get list of running vm's
    [array]$vmNames = @(Get-VM -Running | %{$_.elementname})  
    Write-Host "To: $single_backup_file_to_loc"
    Write-Host "From: $single_backup_file_from_loc"
    #call function to stop vm's
    StopVMsInOrder $vmNames      
    if($single_backup_file_to_loc -ne " ")
       #someone passed in a parameter for one-off use of script
       [array]$destFileArray = @($single_backup_file_to_loc)
       [array]$sourceFileArray = @($single_backup_file_from_loc)
    }else
       Write-Host "To Loc not Defined as param"
       #get set up for what need to backup vhd's
       #where back it up to
    $i=0
    for ($i = $sourceFileArray.GetLowerBound(0); $i -le $sourceFileArray.GetUpperBound(0); $i++) { 
            $tempSource =  $sourceFileArray[$i]
            $tempDest = $destFileArray[$i]
            CopyFileToFolder $tempSource $tempDest
            Write-Host "i: $i"
    Write-Host "Done with vhd backup"
    #call function to start vm's
    StartVMsInOrder $vmNames  
    Write-Host "Done with vm start"
    Michele Cleary

    I finally figured it out!  I changed it so I was using the 32 bit version of powershell in TaskScheduler:  %SystemRoot%\system32\....  Now it's finding the VM's!
    Michele Cleary
    Just FYI - system32 is x64. SysWOW64 is x86.
    Don't retire TechNet! -
    (Don't give up yet - 12,700+ strong and growing)

  • My right click on windows, running on mac

    right ive installed windows xp home edition on my macbook, and its running smoothly, and there isnt realy any problems, apart from my right click will not work.
    is this a case of it wont work because its a 1 click button or should it work, if it should work, why isnt it?
    please help

    Hi
    Put two fingers on the trackpad then click the button with your thumb. You soon get used to doing it.
    Bob

  • Right clicking in Windows XP with Boot Camp Not Working

    When I right click with two fingers in Win XP with Boot Camp it doesn't work. I have to plug in a mouse which gets annoying. Any ideas? I'm running Boot camp 2.1 with XP SP3. I have a new Aluminum MacBook 2.4 GHz with 4GB RAM.

    For ppl like me who can't get any combo of fingers to work on XP for the right click / context menu, here's the solution - click on whatever you want to right click on then hit Shift-F10. Voila.
    Problem solved!

  • Left clicking mouse acts as if I'm right clicking, and comes up with right click menu?

    Hi I was wondering whether anyone could help me with this, I've had this problem for a week or so now and it's beginning to get frustrating.
    I have a newish iMac, bought in January, and I've been having this problem the last week or so, where when I left click something, it acts as if I am right clicking it and it comes up with the right click menu. I has happened mostly while on the internet (chrome), but also when I'm just on my desktop, but less often.
    It only happens every so often, and rights itself after a couple of minutes. What could be causing this, and how do I stop it?
    This is my first ever post on here, so I do apologise if I have been vague or I have posted this question in the wrong section, I am also new to macs (well since January).
    The mouse I am using is a dell wired mouse, a couple of years old, which I just plugged in without the need of installing software etc.
    Many thanks for any help in advance.

    Hello & welcome!
    No worries, you did great for a 1st post, & this is generally a friendly place.
    It sounds light it's the Mouse button from here, to test it...
    Go to System Preferences > Mouse, change the Primary button to the Right button... does the Right button ever do that now as the left button?

  • Right-click on a VI with missing dependencies hangs LabVIEW

    Here's the flow:
    1)  Download a VI from the forums that has a missing dependency
    2)  Add the VI to a project
    3)  Right-click on the VI to see if it's set to run-on-open
    4)  Wait a very long time for the dependency load to fail
    How do you all handle the forum VIs? Is it as simple as checking the Files view for missing deps - and only RMB if none are missing?
    I can't find any of the "silently ignore all" posts/ideas except for opening refs.
    When I create new VIs and force a dependency failure, there is not a long delay.

    How do you tell if the VI is set to Run When Opened?  If you are opening the properties dialog, the VI still has to load.
    ***Just performed an experiment***
    Opening the VI from the project overrides the Run When Opened.  Good thing to know.
    But still, when you try to open a VI and there are missing dependencies, you get a dialog that has the Ignore All on it.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    Loading Window.PNG ‏23 KB

  • Right Click doesn't work with Magic Trackpad

    The Magic trackpad is great. Finally I have something like the old trackballs I had to abandon to be able to scroll etc.
    However I can't get the right click to work even though I have the secondary click checked in the trackpad preferences.
    Any ideas how to get it to work?
    Also, a real bummer is I had selected tap to click and went on a trip. My old MBP (pre unibody) with a trackpad and a button below it, doesn't have a "tap to click" option in the preference pane once the Magic Trackpad is no longer connected, so I couldn't disable it until I got home. Bad!

    Bump!
    I have basically the same problem with my magic trackpad. I bought it to get the new features, but with no secondary click it's pretty much useless.
    I have the options set for secondary tap. Which I assume is just like the regular trackpad. Two fingers and click - Context menu. But I just get a regular primary click. I hate to think that i wasted $70. Can anyone help with this? Please.
    Just a side note: My tap-to-click and secondary bottom right click also don't work. Do I have a malfunctioning trackpad?

  • After 10.10.3 update I can no longer right click. Anyone else with this issue?

    After updating to the latest software I am unable to right click on my magic mouse like before. Now I have to use control and click. Anyone else with this issue?

    Did you check the settings in Mouse preferences?
    Download and install the OS X Yosemite 10.10.3 Combo Update.

  • How do I install right click to windows running on mac

    I recently installed windows 7 on my Macbook Pro Retina and cannot right click on windows programs! how do I install this?

    Look in Control Panel -> System -> Boot Camp -> Track Pad tab.

  • Can't right-click in eyeglass view with IE 7

    When using the eyeglass icon to view topics in my project, I
    used to right-click the mouse and select Back to navigate between
    various links. Since IE 7 was installed on my computer, when I am
    in that view and right-click the mouse, nothing happens. Any
    suggestions?

    I couldn't say why RoboHelp is behaving this way for you, I
    have IE 7 (using RH X5) and can still right-click and choose Back.
    You should also be able to just hit the Backspace key to navigate
    backwards as well.
    //Lucas

  • Running a Powershell script via IIS on client machine

    Hello,
    I have a Powershell script that I want to serve to clients that will access my site.
    The script is simple - it will terminate Outlook and Communicator and restart in Cleanfreebusy mode.
    Researching this has noted that there is an IIS plugin that will allow the running of Powershell scripts?
    I would like to ask you, colleagues, is there a way I may be able to do this? That is to allow my clients run this Powershell script without downloading locally.
    Many many thanks,

    I have somewhat of a similar process, where I asked on the ASP.NET forums, as I needed my users of an Intranet site to be able to have a script run with the click of the button. I was told that it was not possible, as the browser is built to not allow stuff
    like this for security reasons.
    I haven't heard of a plugin so maybe there are other ways, but what I actually had to do, was create a batch file, and than on my webpage I added an IFrame
    <iframe id="myIframe" runat="server"></iframe>
    Than either in the html markup you can set the src attribute (I did mine in the code behind), to the directory where the file is at, so for instance \\myserver\fileishere
    Obviously the location needs to be shared and allow all users read/execute. This will display the file on the web page, and then the users, just double click it and it executes.
    You can possibly have a batch file that calls powershell and the script, but the script will need to be downloaded to the users machine, so it may be easier to find a batch equivallent of your powershell script and use DOS commands
    If you find that my post has answered your question, please mark it as the answer. If you find my post to be helpful in anyway, please click vote as helpful.
    Don't Retire Technet

  • Right click Open With sometimes not working (Photoshop Elements 9, Windows Vista)

    We recently upgraded from Photoshop Elements 7 to Photoshop Elements 9. We are running Windows Vista.
    Last night, my wife was right clicking on JPEG images in her My Pictures subfolders and choosing "Open With" to open the files with Photoshop Elements. In some cases, this worked. In other cases she would right click the file, Adobe Photoshop Elements would start, but the picture itself would not display.
    I tested one of these pictures and was able to open it with other applications, and was able to open it by choosing "Open" from Photoshop Elements' file menu.
    Has anyone run into this before? Why are some pictures not opening when you right-click and use "Open With"?

    Hi,
    you can make PSE9 default program for opening any image on you vista machine.
    Then it souhld work fine.
    cheers,
    Sam

  • How do I simulate a right-click in Windows when connected with Remote Desktop 8.0 for Mac OS X?

    When connecting to a remote Windows 7 OS from Mac OS X 10.8.5 with Microsoft Remote Desktop 8.0.24091, I'm not able to simulate a right-click with the Apple magic mouse.  
    On an older version Microsoft Remote Desktop Client version 2.1.1, I can hold down shift+ctl on the Mac and click the magic mouse to simulate a right-click in Windows.  With this new version RDP 8.0, I can't find any way to simulate a right-click,
    other than to select "Swap mouse buttons" under settings, and then every click is a right-click and then I'm no longer able to left-click (which is even worse).  I've tried several key combinations and nothing seems to work.  Am I missing
    something simple here with the new RDP 8.0 application, or is the right-click simulation not (yet) functional?  
    Any help is greatly appreciated, thanks!

    In order to make use of the right-click inside an open session you have three options:
    Standard PC two button USB mouse
    Apple Magic Mouse: To enable right-click, clickSystem Preferences in the dock, click Mouse, and then enable Secondary click.
    Apple Magic Trackpad or MacBook Trackpad: To enable right-click, click System Preferences in the dock, click Mouse, and then enable Secondary click.
    Extracted from "Remote desktop Client on Mac: FAQ"
    http://technet.microsoft.com/en-us/library/dn473006.aspx

  • Disable Right Click Context Menu in XP "OPEN WITH ADOBE READER 8"

    How can I eliminate the right click context menu "OPEN WITH ADOBE READER 8" in Windows XP?
    I have general familiarity with removing context menus. I see no option for this one in msconfig, or various context menu editors. I am unable to find a setting in Adobe Reader 8. If you know where the setting is, or have solved this problem, please let me know.
    Thanks,
    Joey

    That would be the device Metadata from the print driver vendor. It's part of the Device Stage feature mainly for client OS.
    Here is some MSDN documentation on the feature.
    http://windows.microsoft.com/en-us/windows7/products/features/device-management
    If this is a print server, use the tools include by the print team if you are performing any management on the server.
    Printmanagement.msc
    The Devices UI is really about devices it's not designed for print management, the spooler team had minimal input on the UI design.
    Alan Morris formerly with Windows Printing Team

  • When right clicking an image in Bridge, the "open with" option doesn't display Fireworks

    This is not the case with all the files, but some.  For example, there was a .jpg file that I couldn't open in Fireworks when right clicking and choosing "open with", although Illustrator and Photoshop were both listed.  Note: I have Cs5 Extended.  Thank you in advance.

    The "open with" menu is set in the OS, not Bridge, so open Windows Explorer and work on it from there to add what you want.

Maybe you are looking for

  • Easy query is not showing on Easy query Management(Browser)

    Dear all,           I want to consume a bex query into SAP UI5. For that I found this document:-      http://cms.int13h.nl/wordpress/wp-content/uploads/2013/01/How-to-Create-OData-Services-for-Analytic-Queries.pdf      In this document, the first ste

  • Interactive script editor: read values of answers into non-branching action

    Dear all, When we develop a new interactive script, I would like to read the value of the answers into a non-branching action. For examle: Are you ill? yes/no If no --> are you staying on another addres then [customer_adres]? yes/no if no --> please

  • A stupid question

    As you can probably tell by me posting this question, I don't use terminal very often. I am playing around with settings for the proxy server and found that I don't particularly know what I am doing. My simple question is this: I am executing the fol

  • Dynamically creating a database block in forms 10g

    hi guys , i got a new requirement ,that is dynamically create a database blocks and items... how it is possible..? thanks...

  • Drag and drop frames ?

    Not sure wether the subject is matching, but here we go: I wan't a window/frame/whatever that can contain smaller windows/frames that all have the same width. When they are in this container they can only be arranged over and under eachother (the con