social.sokoll.com

Search

Items tagged with: policy

I wrote a powershell script to personalize the template paths for Office users and attached it to our Office GPO. It all worked well but every time the policy was pulled, the script window popped up and flashed for a second or so. Every user, every 90 minutes.
I tried "powershell.exe -WindowStyle Hidden", "| Out-Null", ">$nul 2&>1" and the tasks hidden flag but none worked.

Reason is that powershell.exe has a parameter -WindowStyle _with a possible value _Hidden which obviously doesn't work as expected / is broken. The official issue: https://github.com/PowerShell/PowerShell/issues/3028

The workaround I found while reading the thread is:
ps-run.vbs
Set objShell = CreateObject("Wscript.Shell") 
Set args = Wscript.Arguments 
For Each arg In args 
    objShell.Run("powershell -windowstyle hidden -executionpolicy bypass -noninteractive ""&"" ""'" & arg & "'"""),0 
Next

... and then call the powershell script you want to execute like this:
wscript "C:\Path\To\ps-run.vbs" "C:\Other\Path\To\your-script.ps1"

Now I can run my script out of the immediate scheduled task in my GPO without disturbing any user and config their session settings. Yay! Tested with Win10 x64 Build 1809, Win7 x86, Win7 x64.

#powershell #script #gpo #policy #admin
 
I wrote a powershell script to personalize the template paths for Office users and attached it to our Office GPO. It all worked well but every time the policy was pulled, the script window popped up and flashed for a second or so. Every user, every 90 minutes.
I tried "powershell.exe -WindowStyle Hidden", "| Out-Null", ">$nul 2&>1" and the tasks hidden flag but none worked.

Reason is that powershell.exe has a parameter -WindowStyle _with a possible value _Hidden which obviously doesn't work as expected / is broken. The official issue: https://github.com/PowerShell/PowerShell/issues/3028

The workaround I found while reading the thread is:
ps-run.vbs
Set objShell = CreateObject("Wscript.Shell") 
Set args = Wscript.Arguments 
For Each arg In args 
    objShell.Run("powershell -windowstyle hidden -executionpolicy bypass -noninteractive ""&"" ""'" & arg & "'"""),0 
Next

... and then call the powershell script you want to execute like this:
wscript "C:\Path\To\ps-run.vbs" "C:\Other\Path\To\your-script.ps1"

Now I can run my script out of the immediate scheduled task in my GPO without disturbing any user and config their session settings. Yay! Tested with Win10 x64 Build 1809, Win7 x86, Win7 x64.

#powershell #script #gpo #policy #admin
 
bjoern wrote: According to this study France’s technology #procurement #policy that required government agencies to favor #FreeSoftware over proprietary software was a huge success: 0.6% - 5.4% yearly increase in companies that use Free Software, 9% - 18% yearly increase of IT-related startups, a 6.6% - 14% yearly increase in the number of individuals employed in IT related jobs and 600,000 Free Software contributions per year from #France https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3355486 #pmpc #PublicCode
 
bjoern wrote: According to this study France’s technology #procurement #policy that required government agencies to favor #FreeSoftware over proprietary software was a huge success: 0.6% - 5.4% yearly increase in companies that use Free Software, 9% - 18% yearly increase of IT-related startups, a 6.6% - 14% yearly increase in the number of individuals employed in IT related jobs and 600,000 Free Software contributions per year from #France https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3355486 #pmpc #PublicCode
 
Later posts Earlier posts