Announcement

Collapse
No announcement yet.

Scripting Windows XP local accounts

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Scripting Windows XP local accounts

    I was wondering if anyone could help me with a query I have with regards to scripting local user accounts on a number of Windows XP machines.

    The situation is this I have a 71 pc that have a local user account called "subject". This account is used when large scale studies are carried out. The rest of the time these accounts are disabled. At present when a study needs to be carried out someone, normally me, has to walk down to the room and log in as the administrator on each machine and enable the local subject account. After the study is completed, someone then has to go back and disable the subject account on each machine. I've been looking for a way to automate this process and hoped that somone would be able to either tell me what I need to do, or point in the direction where I can find out what needs to be done.

    So basically I want to know if it is possible to enable and disable a local user account on a Windows XP pro machine and if so how do I do this.

    Thank you in advance for any help you can give me with this.

    Mr-F

  • #2
    Re: Scripting Windows XP local accounts

    Ok well after looking around further I think I found part of the solution that I need. If what I understand is correct then I should be able to do what I need by simply using the "net user" command i.e. "net user subject /active:yes".

    However, what is remaining is how I can run this command remotely on multiple machines. I'm guessing that I could do something like this to automate the whole process:

    WshShell.run("\\pcname\c$\WINDOWS\system32\net use subject /active:yes",1,True)

    Am I correct in assuming that since I will be logged in as an Administrator which has the same name and password on all the other machines that I am trying to affect that my creditals will allow the process to run. Unfortunately, I am unable to physically test at the moment and so if anyone knows that this will fail then please could they let me know. Or alternatively if there is a better way to do what I am trying to do then could you let me know.

    Thanks in advance for any help you can give.

    Mr-F

    Comment


    • #3
      Re: Scripting Windows XP local accounts

      Download psexec from http://www.sysinternals.com/utilities/psexec.html. make a text file with the names of all the pcs you want to do this on. run this command from a command prompt.

      psexec -u domain\adminname @file C:\file.txt net user subject /active:yes

      untested so the syntax may be a little off but the method will work.
      MCSE 2000\2003, A+
      00000001-00000011-00000011-00000111

      Comment


      • #4
        Re: Scripting Windows XP local accounts

        Thanks alot pcking, that worked a treat and now I've wrapped that command up within a small C# program so that other can easily alter the computer names and account settings. Thanks again.

        Mr-F

        Comment

        Working...
        X