Postby hsmith » Fri Aug 25, 2006 10:25 am
You could try this VBScript - I dont know if you can run a Vb script from InstallAware as I am brand new to it. But if you cant you could easily create a VB app that does the same .....
Const ADS_UF_DONT_EXPIRE_PASSWD = &h10000
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\\" & strComputer & "\\root\\cimv2")
Set colComputers = objWMIService.ExecQuery _
("Select * from Win32_ComputerSystem")
For Each objComputer in colComputers
strComputer = objcomputer.name
next
Set colAccounts = GetObject("WinNT://" & strComputer & ",computer")
Set objUser = colAccounts.Create("user", "fred")
objUser.SetPassword "password"
objUser.SetInfo
Set objGroup = GetObject("WinNT://" & strComputer & "/Administrators,group")
Set objUser = GetObject("WinNT://" & strComputer & "/fred,user")
objGroup.Add(objUser.ADsPath)
Set objUser = GetObject("WinNT://" & _
strComputer & "/" & "fred" & ",User")
objUserFlags = objUser.Get("UserFlags")
objPasswordExpirationFlag = objUserFlags OR ADS_UF_DONT_EXPIRE_PASSWD
objUser.Put "userFlags", objPasswordExpirationFlag
objUser.SetInfo
PS - This creates an admin account
Regards
Howard Smith