8,330 questions
Hi,
Please see if this works for you. Replace "DC=contoso, DC=com" with your own domain.
New-GPO -Name Autoplay_gpo | New-GPLink -Target "DC=contoso, DC=com"
Set-GPRegistryValue -Name "Autoplay_gpo" -Key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" -ValueName NoDriveTypeAutorun -Type DWord -Value 255
Set-GPRegistryValue -Name "Autoplay_gpo" -Key "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" -ValueName NoAutorun -Type DWord -Value 1
Best Regards,
Ian Xue
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.