Announcement

Collapse
No announcement yet.

find the user sid

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

  • find the user sid

    hi all

    how can i find a user sid
    i need to compare it to the sid in the hkey_users


    thanks

  • #2
    Re: find the user sid

    couldn't help you?
    http://www.google.nl/search?hl=en&q=...user+sid&meta=
    Edit: and even on our mainsite: http://www.petri.com/obj_sid.htm
    Last edited by Dumber; 5th February 2008, 13:13.
    Marcel
    Technical Consultant
    Netherlands
    http://www.phetios.com
    http://blog.nessus.nl

    MCITP(EA, SA), MCSA/E 2003:Security, CCNA, SNAF, DCUCI, CCSA/E/E+ (R60), VCP4/5, NCDA, NCIE - SAN, NCIE - BR, EMCPE
    "No matter how secure, there is always the human factor."

    "Enjoy life today, tomorrow may never come."
    "If you're going through hell, keep going. ~Winston Churchill"

    Comment


    • #3
      Re: find the user sid

      To determine the SIDs of users known to the computer; Read the strored information in registry key;

      HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList

      each known SID is a subkey of that key,
      in each subkey you can find a username in the entry: "ProfileImagePath"
      (see also: forums.petri.com/showthread.php?p=72430#post72430 )

      A VBscript can enumerate this for you.

      - OR -
      If you want to know the SID of the currently logged-on user, on your- or from any remote computer on the network, then use this vbscript;
      Code:
      ' forums.petri.com/showthread.php?p=61469#post61469
      
      Const HKEY_USERS = &H80000003
      
      
      strComputer = "."  '<-- name of remote computer
      
      Set objWMIService = GetObject( _
        "winmgmts:{impersonationLevel=impersonate}!\\" _
        & strComputer & "\root\cimv2")
      
      Set Users = objWMIService.InstancesOf ("Win32_ComputerSystem")
      
       for each User in Users
         logonname = User.UserName
         strUsr    = Split(logonname,"\")(1)
         strDomain = Split(logonname,"\")(0)
         exit For
       next
      
      set colAccounts = objWMIService.ExecQuery _
             ("select * From Win32_UserAccount where " _
             & "name = '" & strUsr & "' AND domain = '" & strDomain & "'")
      
       For each objAccount in colAccounts
         strSID = objAccount.SID       
         exit For
       Next
      
      
      wsh.echo "HKU-path for", logonname, vbNewLine & "HKEY_USERS\" & strSID & "\..."
      \Rems

      This posting is provided "AS IS" with no warranties, and confers no rights.

      __________________

      ** Remember to give credit where credit's due **
      and leave Reputation Points for meaningful posts

      Comment


      • #4
        Re: find the user sid

        Moved to scripting forum.
        Marcel
        Technical Consultant
        Netherlands
        http://www.phetios.com
        http://blog.nessus.nl

        MCITP(EA, SA), MCSA/E 2003:Security, CCNA, SNAF, DCUCI, CCSA/E/E+ (R60), VCP4/5, NCDA, NCIE - SAN, NCIE - BR, EMCPE
        "No matter how secure, there is always the human factor."

        "Enjoy life today, tomorrow may never come."
        "If you're going through hell, keep going. ~Winston Churchill"

        Comment

        Working...
        X