Sign in to follow this  
Followers 0
david7411

Windows XP user management

3 posts in this topic

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



@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

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  
Followers 0