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
LVL 18
IvanSystem EngineerAsked:
Who is Participating?
 
McKnifeCommented:
This is how you configure a domain startup script: https://technet.microsoft.com/en-us/library/cc779329%28v=ws.10%29.aspx?f=255&MSPPError=-2147217396
So check whether you already have a startup script running inside a policy by starting rsop.msc at one client. If not, create one.
If there is one, like I wrote, just add one line:
powershell yourscript.ps1

Open in new window

This will start yourscript.ps1
0
 
McKnifeCommented:
"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)
0
 
IvanSystem EngineerAuthor Commented:
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
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.