473,383 Members | 1,872 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,383 software developers and data experts.

VB code to VB.NET (AD with LDAP)

Hi,

I have the following VB function which I want to translate to VB.NET
code. I'm note very used to AD and LDAP, so maybe someone can help?

'start code
function AddUserToGroup(Username,Groupname)
Dim LDAPDomain, LDAPUsername, CNGroup, Group

LDAPDomain = "cn=Users,dc=ad,dc=mycorp,dc=nl"
Set Group = GetObject("LDAP://cn=" & Groupname & "," & LDAPDomain)
Set UserObject = GetObject("LDAP://cn=" & Username & "," &
LDAPDomain)

Group.Add(UserObject.ADsPath)

end function
'end of code

Thank you in advance

Freek Versteijn
Nov 20 '05 #1
1 3351
Hi,

Take a look at the classes in the system.directoryservices
namespace.
http://msdn.microsoft.com/library/de...tds/portal.asp

Ken
--------------------
"Versteijn" <ve*******@538mail.nl> wrote in message
news:4d**************************@posting.google.c om...
Hi,

I have the following VB function which I want to translate to VB.NET
code. I'm note very used to AD and LDAP, so maybe someone can help?

'start code
function AddUserToGroup(Username,Groupname)
Dim LDAPDomain, LDAPUsername, CNGroup, Group

LDAPDomain = "cn=Users,dc=ad,dc=mycorp,dc=nl"
Set Group = GetObject("LDAP://cn=" & Groupname & "," & LDAPDomain)
Set UserObject = GetObject("LDAP://cn=" & Username & "," &
LDAPDomain)

Group.Add(UserObject.ADsPath)

end function
'end of code

Thank you in advance

Freek Versteijn

Nov 20 '05 #2

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

Similar topics

7
by: Amar | last post by:
I am trying to connect to my college LDAP directory using ASP.NET. This LDap does not have security as it returns only user demographic information. i do not need to bind with a username or...
5
by: Bryan | last post by:
Hello, I have a asp.net app working with directory services on my Windows XP development machine. However when I moved the application over to our production server (Win 2000 Server) it no longer...
3
by: mbasil77 | last post by:
I'm trying to port a piece of Java LDAP conneciton code to DOTNET. I've done LDAP in DOTNET before, but I keep getting a very strange message. The Java code looks like: public static boolean...
0
by: sbartz | last post by:
Greetings, My ldap application relies on user input for a ldap server uri, so I am looking for a way to use the ldap api to determine whether the ldap server is up or not. All the docs have to...
3
by: sallas | last post by:
Hi, I have a simple LDAPS script: #!/usr/bin/python2.3 import sys import ldap if __name__ == '__main__': ldap.set_option(ldap.OPT_DEBUG_LEVEL,255)
3
by: eleland | last post by:
I am trying to bind to an LDAP server using php without success. I have a linux server running php compiled with open ldap. I am using the following code taken right from php.net: echo "<h3>LDAP...
0
by: rbukkara | last post by:
Hi, I have got the following error while trying to add a user in the LDAP Directory. javax.naming.NameNotFoundException: ; remaining name 'uid=vassila,ou=People,dc=cs,dc=uno,dc=edu' I have...
2
by: munkee | last post by:
Hi All, Basically I have been destroying my brain trying to work out how to connect to the LDAP server at work with access to search for info and import. I have a couple of questions. Firstly,...
12
by: munkee | last post by:
Hi all, I am having trouble with connecting to my companies LDAP to retrieve userinfo. I can return basic information from my local area using the following connection settings: Set oRoot =...
0
by: Ken Harvey | last post by:
I am attempting to scan a Windows Active Directory using wincom32.client and LDAP to pull a list of users and their attributes. My problem is that I am unable to get the search working: import...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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.