Hallo zusammen
Ich bin relativ neu in der Entwicklung und habe folgendes Problem:
Ich probiere mit Hilfe eines Codes auf der AD einen Computer einer Gruppe zuzutilen. Jedoch bekomme ich immer folgenden Fehler:
system.reflection.targetinvocationexception wurde nicht behandelt
Ein Aufrufziel hat ein Fehler verursacht.
Kann mir jemand helfen ?
Ich bin relativ neu in der Entwicklung und habe folgendes Problem:
Ich probiere mit Hilfe eines Codes auf der AD einen Computer einer Gruppe zuzutilen. Jedoch bekomme ich immer folgenden Fehler:
system.reflection.targetinvocationexception wurde nicht behandelt
Ein Aufrufziel hat ein Fehler verursacht.
Kann mir jemand helfen ?
Code:
Function AddToGroup() Dim test As DirectoryEntry test = New DirectoryEntry("LDAP://MYDOMAIN.local", "MYUSER", "PW") Dim ggroup As DirectoryEntry = test.Children.Find("CN=TEST,OU=Printer,OU=Gruppen,OU=Users & Groups") Dim c As DirectoryEntry Dim computer As DirectoryEntry c = New DirectoryEntry("LDAP://MYDOMAIN.local", "MYUSER", "PW") computer = c.Children.Find("CN=PC1576,CN=Computers") ggroup.Invoke("add", computer)
Comment