<div>Hi guys,</div> <div></div> <div>I am having some issues with the following script for adding an object to AD - The object being a user and then modifying the properties on it.</div> <div>If anyone could point out some issues it would be great.</div> <div></div>
<div>--------Error--------</div> <div></div> <div></div> <div>
Line 350:
Line 351: Dim adUsers As DirectoryEntries = dirEntry.Children
Line 352: Dim newUser As DirectoryEntry = adUsers.Add("CN=" & sUserName, "user") Line 353:
Line 354: newUser.Properties("givenname").Add(sFirstName)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Nightswish
Member
3 Points
5 Posts
Adding User to AD VB.Net
Aug 19, 2011 06:52 AM|LINK
Line 350: Line 351: Dim adUsers As DirectoryEntries = dirEntry.Children Line 352: Dim newUser As DirectoryEntry = adUsers.Add("CN=" & sUserName, "user") Line 353: Line 354: newUser.Properties("givenname").Add(sFirstName)Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: Unknown error (0x80005000)
smirnov
All-Star
23700 Points
4056 Posts
Re: Adding User to AD VB.Net
Aug 22, 2011 09:16 AM|LINK
On what line it does happen, on #351?
Are you sure that
dirEntry.Path = "LDAP://-LDAP LINE"
hat correct path?