sorry but how i do this .. :s
Main Topics
Browse All Topicssorry to come back ..
I have problem to set password on users . i have error like : " Exception has been thrown by the target of an invocation "
i have all right (admin domain i have no problem to create user).
my code in attachment
(i have find some method on google i back after bas result :s )
thank for your help
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
i think it's wants you want:
'Active Directory.vshost.exe' (Managé) : 'C:\Documents and Settings\rolla\Mes documents\Visual Studio 2005\Projects\Active Directory\Active Directory\bin\Release\Acti
'Active Directory.vshost.exe' (Managé) : 'C:\WINDOWS\assembly\GAC_M
Une exception de première chance de type 'System.Reflection.TargetI
Une exception de première chance de type 'System.Reflection.TargetI
Le programme '[292] Active Directory.vshost.exe: Managé' s'est arrêté avec le code 0 (0x0).
Well,
as this is intriguing I've found a machine in my organization which has the same behaviour. I've also deeply browsed the Microsoft solutions and... there is nothing there... looks like when (and if) you got that error there is nothing known to do.
Tomorrow I'll open a support call with Microsoft, as this looks like a huge bug somewhere in their infrastructure. I let you know.
Cheers
Pino
P.S.: I was wrong about the .Password property, that's the authentication password used to authenticate your session... nothing to do with the user password!
Hi,
that's unbelievable! get rid of the port and it will work!
Instead of
"LDAP://192.168.4.5:389/OU
just use
"LDAP://192.168.4.5/OU=Com
and magically it works! I'm still checking with Microsoft the origin of this strange issue as it's not shown on any machines, just on few of mine and none of their machines. Weird!
Cheers
Pino
Another wierd stuff... I quote the Microsoft engineer: "Dont bother taking the traces, I could repro myself! All I did was put the IP of the domain instead of its DNS. And suddenly it crashed. I will investigate and let you know."
That's something uh? On their machines it worked... but not using the IP address... only using a name present in the DNS...
:)
Hi, here the final diagnosis from Microsoft. As the documentation is misleading I also added a Community Content to this page http://msdn.microsoft.com/
==========================
After taking some network traces, I could discover why our different scenarios work / do not work.
As a reminder, here is what works / do not work:
· Setting the password specifying the server with a DNS name works, with or without a port number in the address.
· Setting the password specifying the IP of the server works only if no port is specified.
In fact, it was all explained in the MSDN for the SetPassword method (http://msdn.microsoft.com
As I told you before, SetPassword ensures that some security policies are used when calling it:
· It first tries to use SSL. As your server does not use SSL, this method silently fails.
· Then, it tries to use Kerberos authentication and encryption capabilities. Kerberos works with a system of tickets which require a name based on DNS. Therefore it requires that you request a ticket *for a server name* and not for an IP address (as addresses could change). This is the reason why, in your case, it does not work: you are binding to an IP address and not a fully qualified DNS name. Putting the port, or not, has not influence since Kerberos do not use them. Youll see in the next point why ports make a difference.
· At last, if all methods have failed, it falls back to calling NetUserSetInfo. This method has been around Windows for a long time and, its not mentioned in the doc, uses under the cover the old Directory protocols as a last resort. It uses the NetBios Name System (NBNS) protocol to make the changes (which is based on SMB protocol). As described in this article, AD, for backward compatibility reasons, still accepts request in NBNS http://www.microsoft.com/t
For interoperability with computers that run earlier versions of Windows, Active Directory domains have NetBIOS names and Active Directory domain controllers register in NBNS and query NBNS when necessary.
I had a look at the network traces and did see NBNS in action. It does *not* work with a port because ADSI simply pass the full address (along with the port) of your server to NBSN, so a SMB request is made saying who has netbios name for x.x.x.x:389? which fails, because NetBios does not accept a port in the IP for name resolution (sounds logicial). Without the port, the IP address is associated a NetBios name and NBNS works.
Also, us being in the domain or not has little to no influence here. Being in the domain might have helped for Kerberos, but now Kerberos works fine with cross forests.
==========================
Cheers
Pino
Business Accounts
Answer for Membership
by: sjors1309Posted on 2008-06-09 at 00:48:08ID: 21741550
Please include inner exception for more information