changing start property of multiple services in registry

hello experts,

i'm trying to change the start property of onesyncsvc service in the registry from 2 to 4 using the code:

$registrypath = 'hklm:SYSTEM\ControlSet001\Services\onesyncsvc'
$name = 'start'
$value = 4
new-itemproperty -path $registrypath -name $name -value $value -propertytype dword

but the problem is onesyncsvc has multiple instances and i need to do this to all of them. the code to find all the onesyncsvc services that i have is not working:

get-childitem -path 'hklm:SYSTEM\ControlSet001\Services\' -recurse | where-object { $ -like "onesyncsvc" }

it keeps telling me "requested registry access is not allowed" which i'm not sure why since i'm running powershell as admin. also, i'm not sure if this is even the right command to use to do this. i'm on windows 10 and using the default powershell that comes with it.