Windows Group Policy

From MgmtWiki
Revision as of 15:59, 9 August 2020 by Tom (talk | contribs) (Powershell Grant logon as Service)

Jump to: navigation, search

Full Title

Set security with Windows Group Policy.

Context

  • While this feature of Windows was crated for control of computers in a Windows domain, it can be set on individual computers as well.

Problems

This feature is a super pain for use by normal users.

Solutions

enable Group Policy Editor (Gpedit.msc) on Windows 10 Home.
If this method fails, there are other methods to try at https://tinyurl.com/majorgeeksgpedit
@echo off 

pushd "%~dp0" 

dir /b %SystemRoot%\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientExtensions-Package~3*.mum >List.txt 
dir /b %SystemRoot%\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientTools-Package~3*.mum >>List.txt 

for /f %%i in ('findstr /i . List.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i" 
pause

Powershell Grant logon as Service

If PowerShell reports an "ExecutionPolicy Error", it may be necessary to change the ExecutionPolicy:

PS > Set-ExecutionPolicy RemoteSigned

... May Result in a signing error -- And then changed to:

PS > Set-ExecutionPolicy Unrestricted

And then use the Script to assign the permission:

PS > .".\Add Account To LogonAsService.ps1" "NT Service\btsyncsvc"

Reset the ExecutionPolicy if desired:

PS > Set-ExecutionPolicy Restricted 

https://gallery.technet.microsoft.com/scriptcenter/Grant-Log-on-as-a-service-11a50893