|
|
|
|
|
Dicas
|
|
Visual Basic (Redes/Comunicações)
|
|
|
Título da Dica: Criando um usuário como membro de um computador remoto
|
|
|
|
Postada em 15/8/2003 por d@®l@n
Private Sub Command1_Click() Dim cont As IADsContainer Dim oUser As IADsUser Dim Group As IADsGroup Dim Member As IADs Dim dom As IADsUser Dim v As Variant
sComputer = InputBox("This script creates a user on a member server or workstation." & vbCrLf & vbCrLf & "Specify the computer name:") sUser = InputBox("Specify the user name:") Set Group = GetObject("WinNT://" & sComputer & "/Administrators") Set cont = GetObject("WinNT://" & sComputer & ",computer")
Set oUser = cont.Create("user", sUser) oUser.Put "Fullname", "John Doe" oUser.SetPassword ("Password") oUser.SetInfo Group.Add ("winnt://" & sComputer & "/" & sUser) If Err.Number > 0 Then MsgBox "Error" Else MsgBox "Success" End If End Sub
|
|
|
|
|