Question Locked

xcacls.vbs to change permissions for multiple folders, multiple owners

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

i need to alter the ownerships and permissions of home folders of about 800 staff members and currently exploring xcacls.vbs to do this.

the current owner of each user's home folder is 'administrator', i need to change the owner of each folder to the respective user i.e john smith should be the owner of \\server\staff\sjohn and jane doe should be the owner of \\server\staff\djane

using xcacls.vbs, i have this so far:

xcacls.vbs \\server\staff\%username% /o %userdomain%\%username%

my question is, without having to apply this individually for each user/folder, is there a way where i can return all the usernames in the staff folder and apply that to xcacls?

any help appreciated! =0)

3 replies

by rob miners

You will need two batch files chperm.bat and addperm.bat. Modify chperm.bat to suit your needs. addperm.bat is populated with the users Logon ID.

chperm.bat
xcacls d:\Server\usrhome\%1 /T /G "Administrators":F "domain admins":F %1:F /Y

addperm.bat
call c:\chperm.bat user1
call c:\chperm.bat user2
call c:\chperm.bat user3
call c:\chperm.bat user18
call c:\chperm.bat user4
call c:\chperm.bat user20
call c:\chperm.bat user101

< Edit to change user names >

Keep us informed as to your progress if you require further assistance.

If you think that any of the posts that have been made by all TR Members, have solved or contributed to solving the problem, please Mark them as Helpful so that others may benefit from the outcome. ;) :D

This discussion is closed to new replies.