Results 1 to 3 of 3

Thread: Local user Accounts

  1. #1
    Junior Member
    Join Date
    Apr 2005
    Posts
    2

    Local user Accounts

    I am developing a software in order to get all infromation about a computer. I retrieves you os configuration, software installed, etc. Among the things it should do, it has to retrieve user accounts that are allowed to get to the computer. For that purpose I am using the netapi32 library using specifically netuserenum. I don´t have to retrieve passwords. This function is only giving me accounts of local users, but i do need too to get domain accounts allowed in my machine, as if you were seeing the user accounts from the control panel. I do know that user account are stored locally in the SAM database and i have been making test even with other tools like pwdump2 or pwdump3 but it still givesme the same accounts than netuserenum. ¿Where are stored the domain user accounts allowed in my machine? Cause i can query the domain controller but it gives me all domain user acount trusted in that domain. I just need those that i added in my computer.

    I hope someone can help.

    Thanks in advanced

  2. #2
    AO Ancient: Team Leader
    Join Date
    Oct 2002
    Posts
    5,197
    I believe... But it's a long time since I played with it and I'm not connected to my domain right now to test it that the following code

    'List Local Users
    '====================

    Wscript.Echo vbcr & vbcr & vbcr
    Wscript.Echo "Local Users"
    Wscript.Echo "==================================="

    objTextFile.WriteLine("--------------------------------------------------------------------------------------------------------------------------")
    objTextFile.WriteLine(vbcr & vbcr & vbcr)
    objTextFile.WriteLine("Local Users")
    objTextFile.WriteLine("============")

    Set colUsers = GetObject("WinNT://" & strComputer & "")
    colUsers.Filter = Array("user")
    For Each objUsers In colUsers
    strLine = objUsers.Name
    objTextFile.WriteLine(strLine)
    Next

    Wscript.Echo "Local Users written to file."
    Found in this thread will work.... You will need to make the initial declarations at the top of the script to make it work but I'm pretty sure it returns what you are looking for or can be suitably edited.
    Don\'t SYN us.... We\'ll SYN you.....
    \"A nation that draws too broad a difference between its scholars and its warriors will have its thinking done by cowards, and its fighting done by fools.\" - Thucydides

  3. #3
    Junior Member
    Join Date
    Apr 2005
    Posts
    2
    It does exactlly what i want... Actually i went to the thread you pointed and use only the part of the script wich loop trought the groups..

    Thank you very much

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •