Allow shared folders to be published
Permettre à des dossiers partagés d’être publiés
Explanation
This policy setting determines whether the user can publish shared folders in Active Directory Domain Services (AD DS).
If you enable or do not configure this policy setting, users can use the "Publish in Active Directory" option in the Shared Folders snap-in to publish shared folders in AD DS.
If you disable this policy setting, users cannot publish shared folders in AD DS, and the "Publish in Active Directory" option is disabled. Note: The default is to allow shared folders to be published when this setting is not configured.
Ce paramètre de stratégie détermine si l’utilisateur peut publier des dossiers partagés dans les services de domaine Active Directory (AD DS).
Si vous activez ou ne configurez pas ce paramètre de stratégie, les utilisateurs peuvent utiliser l’option « Publier dans Active Directory » dans le composant logiciel enfichable Dossiers partagés pour publier des dossiers partagés dans AD DS.
Si vous désactivez ce paramètre de stratégie, les utilisateurs ne peuvent pas publier de dossiers partagés dans AS DS et l’option « Publier dans Active Directory » est désactivée. Remarque : la valeur par défaut est d’autoriser la publication de dossiers partagés lorsque ce paramètre n’est pas configuré.
Registry
HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows NT\SharedFolders- Value name
PublishSharedFolders
| State | Value written |
|---|---|
| Enabled | REG_DWORD = 1 |
| Disabled | REG_DWORD = 0 |
PowerShell
PowerShell commands that write to the registry what the policy would write. Values in angle brackets (<…>) must be replaced.
Writing directly to the registry bypasses Group Policy: if a GPO manages this value, it will be rewritten at the next gpupdate; otherwise the value stays in place (the "tattooing" effect). Prefer a GPO or, locally, LGPO.exe. Run PowerShell as administrator for HKLM. Some policies need a restart or gpupdate /force.
Enable
# Enable: SharedFolders/PublishSharedFolders
$k = 'HKCU:\Software\Policies\Microsoft\Windows NT\SharedFolders'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'PublishSharedFolders' -Value 1 -Type DWordDisable
# Disable: SharedFolders/PublishSharedFolders
$k = 'HKCU:\Software\Policies\Microsoft\Windows NT\SharedFolders'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'PublishSharedFolders' -Value 0 -Type DWordRevert to "Not configured"
# Revert to "Not configured": SharedFolders/PublishSharedFolders
$k = 'HKCU:\Software\Policies\Microsoft\Windows NT\SharedFolders'
Remove-ItemProperty -Path $k -Name 'PublishSharedFolders' -ErrorAction SilentlyContinue