Quantcast
Channel: West Wind Message Board Messages
Viewing all articles
Browse latest Browse all 10393

AddOSUser()

$
0
0
AddOSUser()
Web Connection 5.0
AddOSUser()
12/30/2011
09:16:52 AM
3E90JVDBS Show this entire thread in new window
From:
To:
All
Attachments:
None
Is there a method in the framework for adding an OS user (Win 2008 R2 64). I have a method in my source called AddOSuser() that does this:

lcAdminUser = [someusername]
lcAdminPass = [someuserpass]
lcsystem= Alltrim ( Substr ( Sys ( 0 ) ,1,At ( [#],Sys ( 0 ) ) -1 ) )
lcSystemName= [WinNT://] + lcsystem

oDomain = Getobject ( lcSystemName )
If Upper ( oDomain.Parent ) == [WINNT:]
*-WRONG SYSTEM NAME
Return .F.
Endif

oUser = oDomain.Create ( "user", lcAdminUser )
oUser.SetPassword ( lcAdminPass )
oUser.FullName = lcAdminUser
oUser.Description = "Store Admin for:" + lcStoreName

This worked famously only Win 2003 but no longer works for 2008.

If anyone has any code to contribute or can give me the WWWC method that would brilliant!

Thanks




Viewing all articles
Browse latest Browse all 10393

Trending Articles