PowerShell and GPO

I am attempting to run a PowwerShell script through Group Policy without success, I believe the issue my be that the script is not allowed to run freely on the PC’s, I think I need to change the execution policy? I am running the following in the ‘script Parameters’ option

Powershell -ExecutionPolicy “bypass” -NoProfile -Command “\PATH TO PS1 FILE”

This is a script that will collect a detailed inentory of each PC at logon.

As of right now It will run successfully if I manually run it from a PC after PS prompts me to select ‘R’ to run once, But I have to right click on the file and run in powershell, if I simply double-click the file it will open in notepad.

I am fairly new to this process so any assistance would be appreciated. Thanks.

It would be helpful to provide the code as well as any errors. Specifically for GPOs it’s helpful to enable GPO service logging and reviewing the log for errors.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.