Creating User Account

Got a problem you cannot solve? Try here.
Post Reply
Tomazz
Posts: 1
Joined: Fri Aug 25, 2006 6:21 am

Creating User Account

Post by Tomazz »

I'm very new to InstallAware and my question is probablly dumy. :oops:

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
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Post 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!
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
hsmith
Posts: 12
Joined: Fri Aug 25, 2006 3:36 am
Location: UK
Contact:

Post 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
Gizm0
Posts: 339
Joined: Wed Nov 09, 2005 8:47 pm

Post 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! :P
Panagiotis Kefalidis
Software Design Team Lead
\"In order to succeed, your desire for success should be greater than your fear of failure\"
Install[b]Aware[/b] Software Corporation
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Post by MichaelNesmith »

Thanks Gizm0! That'd be great :)
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
Post Reply