15,910,980 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Emmanuel Cerna (Top 2 by date)
Emmanuel Cerna
19-Mar-14 18:35pm
View
Hi, I'll really appreciate your help...
Im trying to use this code to my visual basic app, to work in my AD
....this is how i addapted to my network...
//this is my button ADD USER
=====================================================================
private void Button_Click_1(object sender, RoutedEventArgs e)
{
string stringDomainName = System.Net.NetworkInformation.IPGlobalProperties.GetIPGlobalProperties().DomainName;
PrincipalContext PrincipalContext4 = new PrincipalContext(ContextType.Domain, stringDomainName,
"LDAP://133.x.x.196/OU=Test,OU=Location,DC=bs,DC=sanluis,DC=net", ContextOptions.SimpleBind, txtadminuser.Text, txtadminpassword.Password);
UserPrincipal UserPrincipal1 = new UserPrincipal(PrincipalContext4,
txtlogin.Text, txtpassword.Password, true);
UserPrincipal1.UserPrincipalName = "PRUEBA USUARIO";
UserPrincipal1.Name = txtnombre.Text;
UserPrincipal1.GivenName = txtnombre.Text;
UserPrincipal1.Surname = txtapellido.Text;
UserPrincipal1.DisplayName = txtnombre.Text + " " + txtapellido.Text;
UserPrincipal1.EmailAddress = txtmail.Text;
UserPrincipal1.EmployeeId = txtid.Text;
}
======================================================================================
When I compile, the Visual Studio dont detect any errors.
But when I execute, it detecs this error:
0x80005000
apparently on the code line:
UserPrincipal UserPrincipal1 = new UserPrincipal(PrincipalContext4,
txtlogin.Text, txtpassword.Password, true);
I hope you can help me to solve this issue. I guess is something about the connection but I really don't know. Thanks for attention!
Emmanuel Cerna
18-Mar-14 16:46pm
View
I already read that post, but I really need your help to create my LDAP
from the data that I told you in the post. There's a picture too, so you can understand my AD structure.
PLEASE AND THANKS FOR HELP!