Geeks With Blogs

News
Employers
Soppa Group India
iSmart Panache Inc
R Systems Internationals Ltd
Technovate eSolutions Pvt Ltd
The contents of this blog are my personal opinion and do not represent in any way the view of my employer.
These postings are provided "AS IS" with no warranties, and confer no rights.

Google PR™ - Post your Page Rank with MyGooglePageRank.com

Narendra Tiwari

Its been very long I posted any comment on my blog.

Recently I was working on a requirement in which I've to migrate groups and users from a Win 2k server to Win 2k3 server, win 2k3 server contains the same groups and users but its not updated for a long time. There were around 1000 groups in Win 2k server to be checked and updated on win 2k3 server.

Thanks to namespace System.DirectoryServices in .Net framework (1.1 onwards) which allows to manage server resources. Here we need to manage the ActiveDirectory which contains groups and users.

With below strategy I achieved my requirement:-

1. Get the list of users and groups in xml format from both the servers.
2. Assuming Win2k3 groups/users are the subset of Win2k groups, I compared both the xml and find the difference, that difference is the effective list of groups/users to be added on Win 2k3 server.
3. Only Win2k3 server contains .Net framework 1.1 so I xcopy the compiled code on win 2k to access both the servers.

Screenshot of application:-

Get User Groups:-  Fill the machine name, user name and password. Click on get groups to get the list of groups and users in xml format.

Add User Groups:-  Fill the Domain name in which it will find the user in AD.

It expects an xml file (test.xml) in above format which contains the users and groups to be added.


if group is already exist it will add only addional users in the group otherwise it will add the complete group with the users.
Logic of adding users in the group.

If user name is "administrator" it will consider it a local user otherwise it will added from Domain e.g. DomainName\UserName.

If user name is other than "administrator" it will first look it in the domain if does not exist in domain it will be added from local machine. If does not exist in either local machine and domain it will be ignored.

 Download the complete sourcecode.

 

Posted on Tuesday, January 12, 2010 6:08 PM .Net | Back to top


Comments on this post: Migrating Active Directory Groups and Users to another server

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Narendra Tiwari | Powered by: GeeksWithBlogs.net