Jump to content
Sign in to follow this  
david7411

Windows XP user management

Recommended Posts

david7411

Hi

I would like to add a user to local group in XP

I can use run net command to add users , but I can't add that user to local group in XP. Net command not work that way

Can I do that with Autoit ? if it can , example is Appreciated.

Thanks in advance

Share this post


Link to post
Share on other sites
ptrex

@david7411

Maybe this can get you started.

$strGroupName = "<GroupName>" ; e.g. Administrators
$strUserName = "<UserName>" ; e.g. SecretUser
$strComputer = "<ComputerName>"


$objGroup = ObjGet("WinNT://" & $strComputer & "/" & $strGroupName)
$objGroup.Add("WinNT://" & $strComputer & "/" & $strUserName)

ConsoleWrite ("Done")

regards,

ptrex

Share this post


Link to post
Share on other sites
skysel

or you could use: "net localgroup administrators username /add" :) and yes, it does work!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.