Powershell shared folder permissions

broken image
broken image

$Ace.AceFlags = 3 # ContainerInherit + ObjectInherit $Ace = ( '\\$ComputerName\root\cimv2:Win32_ACE').CreateInstance() $Trustee = ( '\\$ComputerName\root\cimv2:Win32_Trustee').CreateInstance() Get-WmiObject -Class Win32_LogicalShareSecuritySetting | foreach )

broken image

# List of drives that should not be checked for share permissions

broken image

# on the server not included in the exclude list. # This script will remove the 'Everyone' group from any shares # It would be great if someone can please help me acheive this. This script does list the folder which has Everyone added in share permission, But doesnt remediate the permissions.

broken image

I got the script below from one of the forums but it doesnt work for me on Win10 Desktop. Now the point here is that i dont have the list of the folders on which we need to carry out following change, so i would need help in powershell script which can be set as startup script to help me achive this. Our Enviorment is mix of Windows 8 /10 on clients and Windows 2k8/2k12/2k16 on server side. I have a requirement where my IS Security Team wants us to remove Everyone Group from the shared folders and add Äuthenticated Users group instead.