Page 1 of 1
Creating User Account
Posted: Fri Aug 25, 2006 6:53 am
by Tomazz
I'm very new to InstallAware and my question is probablly dumy.
I would like that my installation in InstallAware would create local user account to which I can set file and folder permissions. Is in InstallAware any command/action which would create that windows user account?
Thanks in advance
Tomaz
Posted: Fri Aug 25, 2006 7:32 am
by MichaelNesmith
Hi Tomaz,
I'm sorry, while you indeed can assign accounts to files and folders, you cannot create a new user account at this time.
Would be a great idea for a new plug-in!
Posted: Fri Aug 25, 2006 10:25 am
by hsmith
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
Posted: Fri Aug 25, 2006 3:28 pm
by Gizm0
You can add the vbscript as a support file and then call the Run Program command for $SUPPORTDIR$\\myscript.vbs.. It will execute the script and insert the account.
I might create a script that does this and post it to the Plugins section for later use.. Wrapping WMI is not so easy!

Posted: Fri Aug 25, 2006 4:03 pm
by MichaelNesmith
Thanks Gizm0! That'd be great
