i have a script which makes C drive inaccessible for domain users and give full permissions to administrator and system. This script i am applying to system via group policy. I am applying the script on start up. when i run the script locally it works fine but when i run with policy it doesnt work.When I apply the same script to user it works fine and lockes the drive for every domain user. Any idea what can be wrong. Below is my code:
Set objShell = CreateObject("Wscript.Shell")
Dim Users : Users = "Domain Users"
objShell.Run ("cmd /c echo y|cacls.exe C:\ /grant administrators:F system:F")
objShell.Run ("cmd /c echo y|cacls.exe C:\ /deny "&Users&":F")