<#====================================================================

Copyright © 2015, September. Michael Pomfret

The following updates the local service file permissions.

====================================================================#>

Write-Host “”

Write-Host “====================================================================”

Write-Host “SharePoint 2013 – Updating file permissions for the local service…”

Write-Host “====================================================================”

Write-Host “”

#HKEY_LOCAL_MACHINE\Software\Microsoft\Office Server\15.0\LoadBalancerSettings

# Read, No Inheritance

# This key contains settings for the document conversion service. Altering this key will break document conversion functionality.

$RegKey = “HKLM:\Software\Microsoft\Office Server\15.0\LoadBalancerSettings”

$acl = Get-Acl $RegKey

$person = [System.Security.Principal.NTAccount]”Local Service”

$access = [System.Security.AccessControl.RegistryRights]”ReadKey”

$inheritance = [System.Security.AccessControl.InheritanceFlags]”ContainerInherit”

$propagation = [System.Security.AccessControl.PropagationFlags]”NoPropagateInherit” #This key and subkeys

$type = [System.Security.AccessControl.AccessControlType]”Allow”

$rule = New-Object System.Security.AccessControl.RegistryAccessRule($person,$access,$inheritance,$propagation,$type)

$acl.ResetAccessRule($rule)

Set-Acl $RegKey $acl