• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

programaticly managing local users/groups

Red Squirrel

No Lifer
Anyone know any good ways to programaticly delete users/groups in windows 2k/xp? I'm guessing the SAM DB is part file part registry, and cannot be altered while windows is running, so wondering if there are built in ways in windows to access it, like commands or something.
 
i know theres plenty of API for finding out user security tokens and such. i am not sure i fyou can say create a new user, but i would figure there probably is a way if you had local system priviledge. i'd google this or check msdn if i were you.
 
I have used VBscript to do this in the past. It is as easy as:

Deleting a User from a Local Group

Removes kenmyer from the local Administrators group on a computer named MyComputer.

strComputer = "MyComputer"
Set objGroup = GetObject("WinNT://" & strComputer & "/Adminstrators,group")
Set objUser = GetObject("WinNT://" & strComputer & "/kenmyer,user")

objGroup.Remove(objUser.ADsPath)

More sample scripts at this website: http://www.activexperts.com/ac...ersgroups/localgroups/
 
Found some stuff thats very useful. Functions NetUserDel, NetUserEnum etc... Have to include a library but it came with devcpp so got lucky there.
 
Originally posted by: KB
I have used VBscript to do this in the past. It is as easy as:

Deleting a User from a Local Group

Removes kenmyer from the local Administrators group on a computer named MyComputer.

strComputer = "MyComputer"
Set objGroup = GetObject("WinNT://" & strComputer & "/Adminstrators,group")
Set objUser = GetObject("WinNT://" & strComputer & "/kenmyer,user")

objGroup.Remove(objUser.ADsPath)

More sample scripts at this website: http://www.activexperts.com/ac...ersgroups/localgroups/

I find that rather useful. Thanks!
 
Back
Top