Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 15th, 2004, 02:31 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default ADSI - Add User to groups

Hi Experts,

Can anyone of you tell me how to add a user to a group in LDAP?

Thanks in advance

Regards
Ganesh
__________________
Regards
Ganesh
http://ganeshprof.blogspot.com
Find your solution here...
 
Old October 15th, 2004, 03:12 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default

I found some piece of code for myself

DirectoryEntry dsParentEntry = new DirectoryEntry(LDAP, UserName, Password);
DirectoryEntry dsGroupEntry = dsParentEntry.Children.Find("MyGoup", "group");
                             // Fails in this line giving syntax error.

object newEntry = dsGroupEntry.Invoke("add", new Object[]{oUser.Path});
dsGroupEntry.CommitChanges();

can anyone tell me the cause of the syntax error

Regards
Ganesh
 
Old October 15th, 2004, 12:44 PM
Authorized User
 
Join Date: Apr 2004
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to sara_1981
Default

Hi Ganesh,
I had this problem before and I used this method
dim user as directoryentry=new ....
dim group as directoryentry=new directoryentry(path,username,password)
group.properties("Members").add(user)
group.commitchanges()
group.close

in above code u add new member to a group
I hope this is helpful
regards



Regards
Sara
 
Old October 15th, 2004, 11:16 PM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default

Thanks Sara for your assistance..

Regards
Ganesh
 
Old October 15th, 2004, 11:22 PM
Authorized User
 
Join Date: Apr 2004
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to sara_1981
Default

Your welcome!!:):):)

Regards
Sara





Similar Threads
Thread Thread Starter Forum Replies Last Post
Add existing AD user to AD group via ADSI? thiazi Classic ASP Basics 0 August 24th, 2007 09:27 PM
get user groups from Active Directory PorcupineRabbit Classic ASP Professional 1 February 6th, 2007 08:09 PM
User Groups survey Snib Forum and Wrox.com Feedback 1 January 21st, 2005 09:35 AM
Loding the groups to where a given user is partof [email protected] BOOK: Professional C#, 2nd and 3rd Editions 0 November 30th, 2004 02:18 PM
Create ADSI User and Exchange Mailbox vbsdp Pro VB 6 2 May 26th, 2004 04:40 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.