J'ai to définissez le local group policy settings et le the local security policy for a couple of machines qui are pas in a Windows domain. Until now, J'ai done that by manually setting le keys in gpedit. Due to le transition to Windows 10, I would like to automate that et use a batch ou PowerShell script to définissez lem. It would be très nice si this can be done sans 3rd-party tools.
How can I définissez lese policies using Powershell ou a batch file?
Thank you for votre answers in advance!
Peter
Comment modifier la stratégie de groupe locale avec un script ?
Re: Comment modifier la stratégie de groupe locale avec un script ?
[PolicyFileEditor](https://www.powershellgallery.com/packages/PolicyFileEditor/3.0.0) is a PowerShell module to manage local GPO registry.pol files.
Brandon Padgett provides an [example usage](https://web.archive.org/web/20181018000009/http://brandonpadgett.com/powershell/Local-gpo-powershell/):
```
$RegPath = 'Software\Policies\Microsoft\Windows\Control Panel\Desktop'
$RegName = 'ScreenSaverIsSecure'
$RegData = '1'
$RegType = 'String'
Set-PolicyFileEntry -Path $UserDir -Key $RegPath -ValueName $RegName -Data $RegData -Type $RegType
```
Brandon Padgett provides an [example usage](https://web.archive.org/web/20181018000009/http://brandonpadgett.com/powershell/Local-gpo-powershell/):
```
$RegPath = 'Software\Policies\Microsoft\Windows\Control Panel\Desktop'
$RegName = 'ScreenSaverIsSecure'
$RegData = '1'
$RegType = 'String'
Set-PolicyFileEntry -Path $UserDir -Key $RegPath -ValueName $RegName -Data $RegData -Type $RegType
```