Déplacer de manière silencieuse les dossiers connus de Windows vers OneDrive
Vérifié avec Microsoft OneDrive 26.153.0809.0004 — mis à jour le 12 juillet 2026
Pris en charge sur : Au minimum Windows Server 2008 R2 ou Windows 7
Chemin dans la console GPO
Configuration ordinateur\Modèles d'administration\OneDrive Description
Ce paramètre vous permet de rediriger les dossiers connus vers OneDrive sans interaction. Pour l’application de synchronisation du build 18.171.0823.0001 ci-dessous, ce paramètre permet de rediriger les dossiers connus vides vers OneDrive (ou les dossiers connus vides déjà redirigés vers un compte OneDrive différent). Dans les versions ultérieures, il redirige les dossiers connus qui ont du contenu et déplace le contenu vers OneDrive. Nous vous conseillons d’utiliser cette stratégie avec le paramètre « Inviter les utilisateurs à déplacer des dossiers Windows connus vers OneDrive ». Si déplacer les dossiers connus silencieusement ne fonctionne pas, les utilisateurs seront invités à corriger l’erreur et continuer. Si vous activez ce paramètre et fournissez votre ID de client, vous pouvez choisir d’afficher une notification aux utilisateurs après que leurs dossiers ont été redirigés. Vous pouvez déplacer tous les dossiers en même temps ou sélectionner ceux que vous voulez transférer. Après le transfert d’un dossier, cette stratégie ne l’affecte pas de nouveau, même dans le cas où vous désactivez la case à cocher dans le dossier. Si vous désactivez ce paramètre ou si vous ne le configurez pas, les dossiers connus de vos utilisateurs ne seront pas redirigés et/ou déplacés de manière silencieuse vers OneDrive.
Registre
SOFTWARE\Policies\Microsoft\OneDrive Générateur d'exports
BETAConfigurez l'état, la portée et les options, puis générez les sorties .reg, PowerShell, Intune et SCCM — ou ajoutez le paramètre à une collection multi-paramètres.
Ces exports écrivent le registre — ce n'est pas une GPO managée. ⓘ
Fichier .reg
Windows Registry Editor Version 5.00
; Exported from gporais.com
; Policy: Déplacer de manière silencieuse les dossiers connus de Windows vers OneDrive
; State: Enabled
; Supported on: Au minimum Windows Server 2008 R2 ou Windows 7
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\OneDrive]
"KFMSilentOptIn"=""
"KFMSilentOptInWithNotification"=dword:00000000
"KFMSilentOptInDesktop"=dword:00000001
"KFMSilentOptInDocuments"=dword:00000001
"KFMSilentOptInPictures"=dword:00000001 Autres formats (PowerShell, Intune, SCCM)
PowerShell
# Exported from gporais.com
# Policy: Déplacer de manière silencieuse les dossiers connus de Windows vers OneDrive
# State: Enabled
# Supported on: Au minimum Windows Server 2008 R2 ou Windows 7
$path = 'HKLM:\SOFTWARE\Policies\Microsoft\OneDrive'
New-Item -Path $path -Force | Out-Null
Set-ItemProperty -Path $path -Name 'KFMSilentOptIn' -Value '' -Type String
Set-ItemProperty -Path $path -Name 'KFMSilentOptInWithNotification' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'KFMSilentOptInDesktop' -Value 1 -Type DWord
Set-ItemProperty -Path $path -Name 'KFMSilentOptInDocuments' -Value 1 -Type DWord
Set-ItemProperty -Path $path -Name 'KFMSilentOptInPictures' -Value 1 -Type DWord Intune XML
Aucune correspondance directe Policy CSP / OMA-URI pour cette stratégie. Utilisez l'onglet Intune Remediation, ou importez l'ADMX dans Intune. Intune Remediation
# === Detection script ===
# Exported from gporais.com
# Policy: Déplacer de manière silencieuse les dossiers connus de Windows vers OneDrive
# State: Enabled
# Supported on: Au minimum Windows Server 2008 R2 ou Windows 7
function Test-RegistryValue {
param(
[Parameter(Mandatory = $true)][string]$Path,
[Parameter(Mandatory = $true)][string]$Name,
[object]$Expected,
[ValidateSet('String', 'DWord', 'MultiString')][string]$Kind = 'String',
[switch]$Absent
)
try {
$item = Get-ItemProperty -LiteralPath $Path -Name $Name -ErrorAction Stop
} catch {
return $Absent.IsPresent
}
if ($Absent.IsPresent) { return $false }
$actual = $item.$Name
if ($Kind -eq 'DWord') { return ([int64]$actual) -eq ([int64]$Expected) }
if ($Kind -eq 'MultiString') {
$actualValues = @($actual)
$expectedValues = @($Expected)
if ($actualValues.Count -ne $expectedValues.Count) { return $false }
for ($i = 0; $i -lt $expectedValues.Count; $i++) {
if ([string]$actualValues[$i] -ne [string]$expectedValues[$i]) { return $false }
}
return $true
}
return [string]$actual -eq [string]$Expected
}
$checks = @(
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\OneDrive' -Name 'KFMSilentOptIn' -Expected '' -Kind String)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\OneDrive' -Name 'KFMSilentOptInWithNotification' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\OneDrive' -Name 'KFMSilentOptInDesktop' -Expected 1 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\OneDrive' -Name 'KFMSilentOptInDocuments' -Expected 1 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\OneDrive' -Name 'KFMSilentOptInPictures' -Expected 1 -Kind DWord)
)
if ($checks -notcontains $false) {
Write-Output 'Compliant'
exit 0
}
Write-Output 'Non-compliant'
exit 1
# === Remediation script ===
# Exported from gporais.com
# Policy: Déplacer de manière silencieuse les dossiers connus de Windows vers OneDrive
# State: Enabled
# Supported on: Au minimum Windows Server 2008 R2 ou Windows 7
$path = 'HKLM:\SOFTWARE\Policies\Microsoft\OneDrive'
New-Item -Path $path -Force | Out-Null
Set-ItemProperty -Path $path -Name 'KFMSilentOptIn' -Value '' -Type String
Set-ItemProperty -Path $path -Name 'KFMSilentOptInWithNotification' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'KFMSilentOptInDesktop' -Value 1 -Type DWord
Set-ItemProperty -Path $path -Name 'KFMSilentOptInDocuments' -Value 1 -Type DWord
Set-ItemProperty -Path $path -Name 'KFMSilentOptInPictures' -Value 1 -Type DWord Scripts SCCM
# Exported from gporais.com
# Policy: Déplacer de manière silencieuse les dossiers connus de Windows vers OneDrive
# State: Enabled
# Supported on: Au minimum Windows Server 2008 R2 ou Windows 7
# SCCM Configuration Item guidance:
# Create a Configuration Item of type "Setting: Script".
# Discovery script: use the Detection script below.
# Remediation script: use the Remediation script below.
# Compliance rule: the Discovery script output equals 'Compliant'.
# === Detection script ===
# Exported from gporais.com
# Policy: Déplacer de manière silencieuse les dossiers connus de Windows vers OneDrive
# State: Enabled
# Supported on: Au minimum Windows Server 2008 R2 ou Windows 7
function Test-RegistryValue {
param(
[Parameter(Mandatory = $true)][string]$Path,
[Parameter(Mandatory = $true)][string]$Name,
[object]$Expected,
[ValidateSet('String', 'DWord', 'MultiString')][string]$Kind = 'String',
[switch]$Absent
)
try {
$item = Get-ItemProperty -LiteralPath $Path -Name $Name -ErrorAction Stop
} catch {
return $Absent.IsPresent
}
if ($Absent.IsPresent) { return $false }
$actual = $item.$Name
if ($Kind -eq 'DWord') { return ([int64]$actual) -eq ([int64]$Expected) }
if ($Kind -eq 'MultiString') {
$actualValues = @($actual)
$expectedValues = @($Expected)
if ($actualValues.Count -ne $expectedValues.Count) { return $false }
for ($i = 0; $i -lt $expectedValues.Count; $i++) {
if ([string]$actualValues[$i] -ne [string]$expectedValues[$i]) { return $false }
}
return $true
}
return [string]$actual -eq [string]$Expected
}
$checks = @(
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\OneDrive' -Name 'KFMSilentOptIn' -Expected '' -Kind String)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\OneDrive' -Name 'KFMSilentOptInWithNotification' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\OneDrive' -Name 'KFMSilentOptInDesktop' -Expected 1 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\OneDrive' -Name 'KFMSilentOptInDocuments' -Expected 1 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\SOFTWARE\Policies\Microsoft\OneDrive' -Name 'KFMSilentOptInPictures' -Expected 1 -Kind DWord)
)
if ($checks -notcontains $false) {
Write-Output 'Compliant'
exit 0
}
Write-Output 'Non-compliant'
exit 1
# === Remediation script ===
# Exported from gporais.com
# Policy: Déplacer de manière silencieuse les dossiers connus de Windows vers OneDrive
# State: Enabled
# Supported on: Au minimum Windows Server 2008 R2 ou Windows 7
$path = 'HKLM:\SOFTWARE\Policies\Microsoft\OneDrive'
New-Item -Path $path -Force | Out-Null
Set-ItemProperty -Path $path -Name 'KFMSilentOptIn' -Value '' -Type String
Set-ItemProperty -Path $path -Name 'KFMSilentOptInWithNotification' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'KFMSilentOptInDesktop' -Value 1 -Type DWord
Set-ItemProperty -Path $path -Name 'KFMSilentOptInDocuments' -Value 1 -Type DWord
Set-ItemProperty -Path $path -Name 'KFMSilentOptInPictures' -Value 1 -Type DWord Vous construisez une collection multi-paramètres ? Ajoutez ce paramètre et générez des exports combinés (.reg, PowerShell, GPO).