Given the following (vbs?) script, does anyone know where the calls to GetObject(" comes from? Looking through the Win32API help file, I see "GetObject" but it appears to be for graphic files only. Any ideas out there?
(What I'm trying to do is add user accounts to a local Windows PC).
(What I'm trying to do is add user accounts to a local Windows PC).
Code:
'Connect to server and create user Set container = GetObject("WinNT://" & ServerName) Set user = Container.Create("User",UserName) User.SetInfo set container = nothing set user = nothing 'Sets Pass, Change Pass at Next Login and Password Never Expires Set User = GetObject("WinNT://" & ServerName & "/" & UserName & ",User") Call User.SetPassword(Password) User.Put "PasswordExpired", 0 '0 = NOT SET User must change pass at next login 1 = SET User must change pass at next login Flags = User.Get("UserFlags") User.Put "UserFlags", Flags XOR &H10000 User.SetInfo set User = nothing 'Puts User in Group Set User = GetObject("WinNT://" & ServerName & "/" & UserName & ",User") Set Group = GetObject("WinNT://" & ServerName & "/" & GroupName & ",Group") Group.Add(User.ADsPath) Group.SetInfo set User = nothing set Group = nothing
Comment