Prev: Access 2000 limitations
Next: ActiveX EXE Clues
From: Dan Crossett on 14 Jul 2010 18:47 During PC setup and before a computer is logged into the domain I want to add a AD user to a local group. Here is the logic I am trying: Dim deLocal As New DirectoryServices.DirectoryEntry("WinNT://" + Environment.MachineName + ",computer") Dim sUserDN As String = "CN=UserID,OU=Marketing,DC=MyDomain,DC=com" Dim deUser As New System.DirectoryServices.DirectoryEntry("LDAP://MyDomain.com/" & sUserDN, "ADadmin", "password", DirectoryServices.AuthenticationTypes.Secure) Dim deGroup As DirectoryServices.DirectoryEntry deGroup = deLocal.Children.Find("Administrators", "group") Try deGroup.Invoke("Add", New Object(), deUser.Name.ToString) Catch MsgBox("Add user failed!") End Try
|
Pages: 1 Prev: Access 2000 limitations Next: ActiveX EXE Clues |