Link to home
Start Free TrialLog in
Avatar of Ivan
IvanFlag for Serbia

asked on

Run Windows PowerShell via GPO

Hi all,

I have a problem with running one PS script, via GPO. The script is named Hide-WUUpdate, and can be downloaded from https://gallery.technet.microsoft.com/scriptcenter/2d191bcd-3308-4edd-9de2-88dff796b0bc 

When imported and run it is used to hide a specific Windows Update. Now if I log to computer, open PS and run it via command it is going to hide Skype from list of updates..or any other updated.
PS C:\WINDOWS\system32> Hide-WUUpdate -Title "Skype*" -KBArticleID "KB2876229" -MicrosoftUpdate -Confirm:$false

Now I have a problem when I run it via gpo. Can some1 post how to run it, specially how to enter this commands, eg. parameters to run?
skype.jpg
Avatar of McKnife
McKnife
Flag of Germany image

"Now I have a problem when I run it via gpo" - fine, what problem?
To deploy a script, save the commands to a .ps1 file (power shell script file) and run that script from your domain startup batchscript like
powershell yourscript.ps1

You need to make sure, that script execution is turned on, this can be done by GPO, see http://windowsitpro.com/powershell/controlling-powershell-execution-policy-settings-domain
(set to enabled+allow local and remote signed scripts)
Avatar of Ivan

ASKER

Hi,

can you explain that a bit more? This script has hundreds of line of code, and I cannot put additional lines of commands that need to be done in it, because I don't know where to put them. I only know how to run it when I enter commands in shell, like I wrote before.
So I need a step by step guide for dummies.. I have tried like in the picture and it does not work.
How would I reconfigure script, or create a batch that will run this script with additional commands?

If it is to complicated, then nvm :)

Regards,
gpo.jpg
ASKER CERTIFIED SOLUTION
Avatar of McKnife
McKnife
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial