Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
S

SIFNOk

@SIFNOk
About
Posts
1
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Join computer to domain using vb.net
    S SIFNOk

    Hi All, Im developing a app that joins a computer to a domain, but having trouble implementing it using vb.net, any one assist or had the same issue. Much would be appericatied. Regards Dave Below is the code i have so far to join a computer to a domain :S

    Dim args(4) As String
    'Dim args2(2) As String

        Dim retVal As Long 
        Dim comp As System.Management.ManagementObject 
        Dim comps As System.Management.ManagementObjectCollection 
        Dim clsComps As New System.Management.ManagementClass("Win32\_ComputerSystem") 
        comps = clsComps.GetInstances() 
        For Each comp In comps 
            'This is used to unjoin the domain 
            ''args2(0) = "Password" 
            ''args2(1) = "User with privs" 
            ''args2(2) = "0" 
            ''comp.InvokeMethod("UnjoinDomainOrWorkgroup", args2) 
    
            'this is used to join the domain 
            args(0) = txtdomain.text 'Took out our FQDN for this posting
            args(1) = "txtpassword.text 'I took the password info out for this posting
            args(2) = txtadminaccount 'I changed the admin account info for this posting
            args(3) = "ou=Workstations" 
            args(4) = 1 
            For x = 0 To 4 
                'read back each value for debugging 
                MsgBox(CStr(args(x))) 
            Next 
            retVal = comp.InvokeMethod("JoinDomainOrWorkgroup", args) 
        Next 
        Return retVal
    
    .NET (Core and Framework) csharp help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups