Jump to content

Get Users SID and edit Registry for that User


ejbmail
 Share

Recommended Posts

I need to access remote PC's and get a Users SID and then edit that users Registry for some settings.

How would I go about getting that users SIS and then edit the Registry for that user only.

Thanks in Advance.

PSGETSID works well for this

from sysinternals.com

---"Educate the Mind, Make Savage the Body" -Mao Tse Tung

Link to comment
Share on other sites

PSGETSID works well for this

from sysinternals.com

I know this program but due to the fact that I'm new at this scripting stuff I cannot figure out how to use the sid once I got it.

I'm having to make some registry changes to remote computers for a specific user account. So I need to obtain that sid and then make changes to reg keys under HKEY_USERS\Users SID\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced

What I can't seem to figure out is how to use the SID I received from psgetsid.

Help please.

Link to comment
Share on other sites

I know this program but due to the fact that I'm new at this scripting stuff I cannot figure out how to use the sid once I got it.

I'm having to make some registry changes to remote computers for a specific user account. So I need to obtain that sid and then make changes to reg keys under HKEY_USERS\Users SID\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced

What I can't seem to figure out is how to use the SID I received from psgetsid.

Help please.

Assign the result to a variable and then use the variable in a Regread()/RegWrite() statement.

or try this:

MsgBox(0,"test","the SID is: " & GetSID())

func GetSID($sInput = '' )
    $fOutput = "c:\temp\test.txt"
    if $sInput = '' then 
        $sInput = inputbox("Test","Input user or SID")
    EndIf
    RunWait(@ComSpec & ' /c ' & 'psgetsid ' &$sInput & ' > ' & fOutput,'',@SW_HIDE)
    Return FileReadLine($fOutput,2)
    If fileexists($fOutput) then filedelete($fOutput)
EndFunc
Edited by blademonkey

---"Educate the Mind, Make Savage the Body" -Mao Tse Tung

Link to comment
Share on other sites

Refer this, sevastian

Set colItems = objWMIService.ExecQuery ("Select * from Win32_UserAccount Where LocalAccount = True AND Name = '" & strFlagSID & "'")

If IsObJect(colItems) = 0 OR colItems.Count = 0 Then

Set colItems = objWMIService.ExecQuery ("Select * from Win32_UserAccount Where LocalAccount = True AND Name = 'Administrator'")

End If

For Each objItem in colItems

Wscript.StdOut.Write objItem.SID & vbCrLf

Next

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...