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

Sunday, December 12, 2010

c#: Outlook plug-in


Many people prefers to work directly from their email program. Even though you may have a cool website, the convenience of working directly from your email program in response to an email is one of the best way to boost the productivity of people. This is an outlook plug-in designed to full fill the needs of an offline system with ease and convenience of working directly from Outlook.

If you have a web service and a mailbox processor, writing an Outlook plug-in is very easy and rewarding. You can easily add offline capability for many tasks without needing any special software on users computer. If you are connected to a back-end system, this plug-in forwards all calls to the back end system. If you are offline, this plug-in formats the message in a specific way and then emails to a mailbox which will process and update the back end system.

Based on the currently selected item in outlook, this plug-in enables or disables appropriate buttons. For eg, if you select an existing ticket email, then CreateTicket button is disabled.

It may be necessary to add toolbars to the Outlook menu bar and/or to the Message Item window. By adding to the menu bar, you can respond to many emails at once without opening one at a time.


Programming Logic:
- Create new buttons and attach event handlers to each for them.
- OnButtonClick event, check the sender and take appropriate actions
- When the selected email changes, check and enable/disable buttons
- If online, use the back-end system directly.
- If offline, compose new email with commands and send to a monitored mailbox
- Create Windows Forms for Configuration and additional data

download code

-paul