Postada em 16/03/2005 13:54 hs
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
|