Monday, December 20, 2010

wpf: Setting folder permissions on NetApp server.


Recently I was working on a project to set folder permissions on one of our file servers. We are migrating to a new corporate domain structure with new user names.
Neither the old and new domains are in a single forest nor do have a two way trust. Once we are migrated to the new domain, we want the users to have access to their files with their new user credentials. This file server is a NetApp server and folders are secured using NTFS file system permissions. Even though this server can be managed using windows explorer, it doesn't support WMI or RPC to get/set permissions. Luckily I was able to use ICACLS to enumerate and set permissions on these folders.

[If you want to set permissions on a windows based file server, you can use ICACLS or the native DirectorySecurity namespace or WMI.]

Highlights:
- If the log on user is a department owner, he can specify the folder to start
- Use background thread to do the job. This will free up the mail UI thread and better program responsiveness
- Log results to a database for reporting
- Email the user once the process is finished
- Display % completed, total directories, completed directories and currently executing commands
- Display vista style progressbar on non vista platforms.

download code

-paul