Jump to content

Recommended Posts

Posted (edited)

Hi,

 

Will having a group policy to remove the 'Run' item from menus, thus preventing UNC path access also affect the running of powershell scripts from a UNC location?

 

I cannot get a powershell script to run on a user workstation, it is a computer policy which has security filtering added to tie it to specific computers.

 

Further info:

 

The script is in the 'powershell scripts' tab, not the 'scripts' tab

 

Script Name:

 

%windir%\System32\WindowsPowerShell\v1.0\powershell.exe

 

Script Parameters:

 

-Noninteractive -ExecutionPolicy Bypass -Noprofile -Confirm:$false -file %~dp0test.ps1

 

(the %~dp0 is supposed to convert this to a UNC path on the scripts directory on SYSVOL.)

 

Anyone have any ideas? I just want to remove some microsoft store apps from a user workstation. Does a computer policy automatically run as the SYSTEM user? Will this affect its ability to remove apps from a user login?

 

Cheers

Edited by SimonInOz
Posted
Yes, it is already selected and saved as part of the group policy object.

 

But above you said you have selected the powershell.exe as the script, which it shouldn't. You just need the ps1 file selected.

Posted

Ok, that one is talking about putting the script in the Scripts section though, rather than Powershell Scripts section. :)

 

This is how we do our PS1 scripts.

 

Test1.png

Posted (edited)

Man, that was it. Sometimes, it is hard to see the wood for the trees right? You saved me some hours troubleshooting something that was pretty straightforward. Thanks for putting your eyes across this and assisting.

 

Cheers!

Edited by SimonInOz

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...