Sign in to follow this  
Followers 0
ejbmail

Get Users SID and edit Registry for that User

7 posts in this topic

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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

Share this post


Link to post
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

Share this post


Link to post
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
Sign in to follow this  
Followers 0