Announcement

Collapse
No announcement yet.

PC einer Gruppe hinzufügen

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • PC einer Gruppe hinzufügen

    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 ?


    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)

  • #2
    Ein DirectoryEntry(dein ggroup Object) hat keine add Methode.

    Comment


    • #3
      Hallo

      Probier mal
      Code:
        ggroup.InvokeSet("Children", computer)
      cu

      Comment

      Working...
      X