locked
Create a New local user on Windows Server 2003 from Commandline ( using dsadd.exe) RRS feed

  • Question

  • Hi,

     

    As part of installation process of my application on any server. I need to create a new local user. I wanted to do this using batchfile where I can use dsadd.exe to create the local username with password using the following command. But it's not working.

     

    Please help me out what is wrong here. And suggest me how such be the command name .

     

    dsadd.exe user "cn=gpgtest" -pwd TestUser123.
    
    this returns an error message as given below:
    
    
    dsadd Failed: The specified domain either does not exist or could not be contacted.
    
    
    

    can someone tell me how to add local user to my windows server 2003 from command line. so That I can use it in my batchfile for creating user-name while installation.

    Monday, May 23, 2011 3:51 PM

Answers

  • Hi Einstein,

    Please use command, "net user  gpgtemp Current123 /add".

     


    Regards,
    Rick Tan
    • Marked as answer by Rick Tan Monday, May 30, 2011 2:03 AM
    Wednesday, May 25, 2011 3:21 AM

All replies

  • Hello, EinteinEMC2.

    Look at this link.

    Regards.


    Oscar Abad -- MCITP Enterprise Administrator // MCITP Server Administrator
    Monday, May 23, 2011 4:45 PM
  •  

    Hi OSCar Abad,

     

    Thanks for sharing the link.

    I followed the link and tried the command below to add the below user to local.  but was unable to do so, with all the commndas which I have mentioned.

     

    C:\>dsadd user CN=gpgtemp,CN=Users,DC=GNGWORK -samid gpgtemp -pwd Current123
    
    C:\>dsadd user "CN=gpgtemp,CN=Users,DC=GNGWORK -samid gpgtemp" -pwd Current123
    
    C:\>dsadd user "CN=gpgtemp,CN=Users,DC=GNGWORK" -samid gpgtemp -pwd Current123
    
    C:\>dsadd user CN=gpgtemp,CN=Users,DC=GNGWORK,DC=R1SGTRNMSTR -samid gpgtemp -pwd Current123
    
    C:\>dsadd user "CN=gpgtemp,CN=Users,DC=GNGWORK,DC=R1SGTRNMSTR -samid gpgtemp" -pwd Current123
    
    C:\>dsadd user CN=gpgtemp,CN=Users -samid gpgtemp -pwd Current123
    
    C:\>dsadd user "CN=gpgtemp,CN=Users -samid gpgtemp" -pwd Current123
    
    C:\>dsadd user "CN=gpgtemp,CN=Users" -samid gpgtemp -pwd Current123

     

    They all gave the same error message as shown below:

     

    dsadd failed: The specified domain either does not exist or could not be contacted.
    
    type dsadd /? for help.

     

    Can some one please let me know how do I identify what are the existing domains on my server? I havent found any domains on this server. I right selected "Mycomputer" and did look into properties. Under "Computer Name" Tab, the saw the workGroup name shown as "GNGWork".

     

    Please help to create a new user locally for windows 2003 server R2 from command line.

     

    Thanks in Advance

     

    • Marked as answer by EinsteinEMC2 Monday, May 23, 2011 8:40 PM
    • Unmarked as answer by EinsteinEMC2 Monday, May 23, 2011 8:40 PM
    Monday, May 23, 2011 6:35 PM
  • I just found that the machine on which I am trying to create local new-user doesn't have the domain name.

    I found that by trying IPCONFIG /all

     

    c:>/ipconfig /all

    connection-specific DNS suffix : <blank>

     

    can someon please let me know how to create new username from commandline where there is no domain n ame.

    can we create new user without having domain name?

     

    please provide me steps for doing so. I need an user account to be created locally for the server.

    Monday, May 23, 2011 8:47 PM
  • Hi Einstein,

    Please use command, "net user  gpgtemp Current123 /add".

     


    Regards,
    Rick Tan
    • Marked as answer by Rick Tan Monday, May 30, 2011 2:03 AM
    Wednesday, May 25, 2011 3:21 AM
  • Hi,

    You need to use "net user" command for creating local accounts.

    net user gpgtest /add TestUser123

    This should be helpful.

     

    -Sree

    Wednesday, May 25, 2011 10:59 AM
  • Thanks for the response. It works :)

    Thank you very much


    • Edited by EinsteinEMC2 Tuesday, May 31, 2011 6:28 PM spel mistake
    Tuesday, May 31, 2011 6:22 PM