Your code uses GPO_SECTION_USER instead of GPO_SECTION_MACHINE. Please change, run and reboot (you don't have code to enforce policy) to check if it works.
Disable removable disks via GPO

ypf
21
Reputation points
Hello, I would like to use GPO control group policy to prohibit -- > removable disk: deny read permission
This is my code, but can't disable removable disks. Is there a problem with the code? There is no better way. It's invalid to modify the registry directly. I took a snapshot of the registry according to the historical records. After restarting the computer, I found that the value of a key changed and could not be controlled
Accepted answer
Open the key location with RegEdit.exe and see if the key is created successfully or not. This will help determine the nature of problem.
Also, I assume you're not using "Home" version of Windows and have "Group Policy Client (gpsvc)" Windows Service running, as these are the requirement for GPO to work.
Good idea. Thank you for your advice. I'll give it a try
I use the win10 professional version, should not appear GPO does not work
I found the reason, I sent the wrong parameter...
'status = pGPO->Save(FALSE, TRUE, &Registerid, &ThisGuid);' Change to 'status = pgpo - > Save (TRUE, TRUE, & registerid, & thisguid);' The 'Save' method also distinguishes' GPO_ SECTION_ USER' and 'GPO_ SECTION_ MACHINE ', I use 'GPO_ SECTION_ Machine ', so need to use ' TRUE' in 'Save' method
Sign in to comment