Skip to content

Instantly share code, notes, and snippets.

@dpo007
Last active January 16, 2020 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dpo007/c255edba7aff4ee949b54f02a985ac40 to your computer and use it in GitHub Desktop.
Save dpo007/c255edba7aff4ee949b54f02a985ac40 to your computer and use it in GitHub Desktop.
PowerShell script :: Set "Share Across Devices" settings in Windows 10
##########################
# Sets "Share Across Devices" settings in Windows 10 to On/My devices only.
# - DPO, Jan. 2020
##########################
$path1 = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\CDP'
$path2 = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\CDP\SettingsPage'
$regKeys = @{
CdpSessionUserAuthzPolicy = '1'
NearShareChannelUserAuthzPolicy = '1'
RomeSdkChannelUserAuthzPolicy = '1'
}
if (!(Test-Path $path1)) {
New-Item -Path $path1 -Force | Out-Null
}
foreach ($regKey in $($regKeys.Keys)) {
New-ItemProperty -Path $path1 -Name $regKey -Value $regKeys[$regKey] -PropertyType DWORD -Force | Out-Null
}
if (!(Test-Path $path2)) {
New-Item -Path $path2 -Force | Out-Null
}
New-ItemProperty -Path $path2 -Name 'RomeSdkChannelUserAuthzPolicy' -Value $regKeys['RomeSdkChannelUserAuthzPolicy'] -PropertyType DWORD -Force | Out-Null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment