Home
Forums
New posts
Search forums
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
C# Community
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Home
Forums
Visual Studio .NET
.NET Framework
Help with LDAP
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="ny3ranger" data-source="post: 5493" data-attributes="member: 2062"><p>Hi,</p><p>I have this problem. I am trying to create a simple winform that will read users in active directory and modify the profile path of users. I am having a hard time reading users. I am probably using the wrong path for LDAP.</p><p></p><p>My active directory structure is as follows.</p><p></p><p>my domain is "ffhsj.com"</p><p>And then under that I have a folder called "NY"</p><p>Inside that I have a folder called "Users and Groups"</p><p></p><p>I made a test user called testtw and Im trying to read its properties.</p><p>I made a simple winform put a label on it to see if I can read its properties</p><p></p><p><span style="font-size: 10px"><span style="color: #008000"><span style="font-size: 10px"><span style="color: #000000">I dragged a DirectoryEntry component onto my visual studio .NET 2003 and put the path</span></span></span></span></p><p></p><p><span style="font-size: 10px"><span style="color: #008000"><span style="font-size: 10px"><a href="http://ldap://uid=testtw,ou=Users">LDAP://uid=testtw,ou=Users</a> and Groups, ou=NY, dc=ffhsj, dc=com</span></span></span></p><p></p><p><span style="font-size: 10px"><span style="color: #008000"><span style="font-size: 10px">and then in the code.</span></span></span></p><p></p><p><span style="font-size: 10px"><span style="color: #008000"><span style="font-size: 10px">In form load I have this</span></span></span></p><p><span style="font-size: 10px"><span style="color: #008000"><span style="font-size: 10px"><span style="font-size: 10px"><span style="color: #0000ff">Dim</span></span><span style="font-size: 10px"> User </span><span style="font-size: 10px"><span style="color: #0000ff">As</span></span> <span style="font-size: 10px"><span style="color: #0000ff">New</span></span><span style="font-size: 10px"> System.DirectoryServices.DirectoryEntry(<a href="http://ldap://uid=testtw,ou=Users and Groups, ou=NY, dc=ffhsj, dc=com">LDAP://uid=testtw,ou=Users and Groups, ou=NY, dc=ffhsj, dc=com</a>)</span><span style="font-size: 10px">Label1.Text = User.Properties.PropertyNames.Count.ToString</span></span></span></span></p><p></p><p><span style="font-size: 10px"><span style="color: #008000"><span style="font-size: 10px"><span style="font-size: 10px">But it seems that I cant read it.</span></span></span></span></p><p></p><p><span style="font-size: 10px"><span style="color: #008000"><span style="font-size: 10px"><span style="font-size: 10px">Can anyone help???</span></span></span></span></p><p></p><p><span style="font-size: 10px"><span style="color: #008000"><span style="font-size: 10px"><span style="font-size: 10px">Thanks,</span></span></span></span></p><p><span style="font-size: 10px"><span style="color: #008000"><span style="font-size: 10px"><span style="font-size: 10px">Tash</span></span></span></span></p><p><span style="font-size: 10px"><span style="color: #008000"><span style="font-size: 10px"><span style="font-size: 10px"></span></span></span></span></p></blockquote><p></p>
[QUOTE="ny3ranger, post: 5493, member: 2062"] Hi, I have this problem. I am trying to create a simple winform that will read users in active directory and modify the profile path of users. I am having a hard time reading users. I am probably using the wrong path for LDAP. My active directory structure is as follows. my domain is "ffhsj.com" And then under that I have a folder called "NY" Inside that I have a folder called "Users and Groups" I made a test user called testtw and Im trying to read its properties. I made a simple winform put a label on it to see if I can read its properties [size=2][color=#008000][size=2][color=#000000]I dragged a DirectoryEntry component onto my visual studio .NET 2003 and put the path[/color][/size][/color][/size] [size=2][color=#008000][size=2][color=#000000][/color][/size][/color][/size] [size=2][color=#008000][size=2][url="ldap://uid=testtw,ou=Users"]LDAP://uid=testtw,ou=Users[/url] and Groups, ou=NY, dc=ffhsj, dc=com[/size][/color][/size] [size=2][color=#008000][size=2][/size][/color][/size] [size=2][color=#008000][size=2]and then in the code.[/size][/color][/size] [size=2][color=#008000][size=2][/size][/color][/size] [size=2][color=#008000][size=2]In form load I have this[/size][/color][/size] [size=2][color=#008000][size=2][size=2][color=#0000ff]Dim[/color][/size][size=2] User [/size][size=2][color=#0000ff]As[/color][/size][size=2] [/size][size=2][color=#0000ff]New[/color][/size][size=2] System.DirectoryServices.DirectoryEntry([url="ldap://uid=testtw,ou=Users and Groups, ou=NY, dc=ffhsj, dc=com"]LDAP://uid=testtw,ou=Users and Groups, ou=NY, dc=ffhsj, dc=com[/url])[/size][size=2]Label1.Text = User.Properties.PropertyNames.Count.ToString[/size][/size][/color][/size] [size=2][color=#008000][size=2][size=2][/size][/size][/color][/size] [size=2][color=#008000][size=2][size=2]But it seems that I cant read it.[/size][/size][/color][/size] [size=2][color=#008000][size=2][size=2][/size][/size][/color][/size] [size=2][color=#008000][size=2][size=2]Can anyone help???[/size][/size][/color][/size] [size=2][color=#008000][size=2][size=2][/size][/size][/color][/size] [size=2][color=#008000][size=2][size=2]Thanks,[/size][/size][/color][/size] [size=2][color=#008000][size=2][size=2]Tash [/size][/size][/color][/size] [/QUOTE]
Insert quotes…
Verification
Post reply
Home
Forums
Visual Studio .NET
.NET Framework
Help with LDAP
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top
Bottom