473,385 Members | 1,630 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Add ActiveDirectory user to Global Security Group

Hi All,

I am struggling with a problem, i want to add ActiveDirectory user to
Global Security Group using C# and DirectoryServices. Any suggestiion
???

Thanks.

Nov 20 '06 #1
1 3855
>I am struggling with a problem, i want to add ActiveDirectory user to
>Global Security Group using C# and DirectoryServices. Any suggestiion
1) Bind to the group in question.

DirectoryEntry group = new
DirectoryEntry("LDAP://cn=MyGroup,ou=SomeOU,dc=company,dc=com");

2) Call the .Add method on the "member" property of the group,
specifying the user to add with its distinguishedName

group.Properties["member"].Add("cn=Joe
User,ou=Research,ou=HQ,dc=company,dc=com");

3) Call .CommitChanges on the group to commit the changes to the store

group.CommitChanges();
Done!

Marc
Nov 21 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: bob | last post by:
Hi, Is this the right place to dicuss Visual Studio 2005 and .Net 2? I am try to implement a class (already using Windows Authentication) where I am given a user name and I return a list of...
2
by: TK | last post by:
How can I show a list of OS users and groups in an ASP.NET page? Is there MSDN or SDK articles? please help. TK
4
by: ruca | last post by:
Hi, I have a Login Page that have Active Directory permissions. I can get the domain and the user that are trying to access application, but I need to "know" the password that user insert,...
0
by: dhnriverside | last post by:
Hi guys I want to find out which of my ActiveDirectory users is logged on to a particular ActiveDirectory Computer. I can get what Computer a user is logged on to with ...
11
by: Derek Martin | last post by:
Using VB.Net, I would like to retrieve the currently logged in user's DN from Active Directory. Alternatively, if, using WindowsIdentity, or something similar, I would like to get the user's full...
15
by: sflynn | last post by:
I've just created a new program in Visual Studio 2005, Visual Basic. I can publish, install, and run the program just fine as long as the user is a member of the "Domain Admins" group. My problem...
0
by: tbb | last post by:
Hi I have written an application in which I am using AD groups to set the program permissions. sample code: System.Security.Principal.WindowsIdentity ident =...
0
by: Uli Netzer | last post by:
Hi all, I'm trying to add a user from another domain (domain trust and rights are there) to a group in our domain. It's a domain local security group. I get the following errors: The server...
0
by: myth0s | last post by:
Hi, The question: Is it possible to have two differents ActiveDirectory Membership Provider in web.config and change at run-time from the default provider to the second provider if the first one...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.