Creating User Account

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

Creating User Account

Postby Tomazz » Fri Aug 25, 2006 6:53 am

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:

Postby MichaelNesmith » Fri Aug 25, 2006 7:32 am

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
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/

hsmith
Posts: 12
Joined: Fri Aug 25, 2006 3:36 am
Location: UK
Contact:

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

Gizm0
Posts: 339
Joined: Wed Nov 09, 2005 8:47 pm

Postby Gizm0 » Fri Aug 25, 2006 3:28 pm

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\"
InstallAware Software Corporation

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Fri Aug 25, 2006 4:03 pm

Thanks Gizm0! That'd be great :)
Michael Nesmith

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/


Return to “Technical Support”

Who is online

Users browsing this forum: Majestic-12 [Bot] and 122 guests