ejbmail Posted January 16, 2008 Posted January 16, 2008 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.
blademonkey Posted January 16, 2008 Posted January 16, 2008 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 thisfrom sysinternals.com ---"Educate the Mind, Make Savage the Body" -Mao Tse Tung
Developers Jos Posted January 16, 2008 Developers Posted January 16, 2008 Search for SID on this forum and you will get hits with the answer SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
ejbmail Posted January 17, 2008 Author Posted January 17, 2008 PSGETSID works well for thisfrom sysinternals.comI 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\AdvancedWhat I can't seem to figure out is how to use the SID I received from psgetsid.Help please.
blademonkey Posted January 17, 2008 Posted January 17, 2008 (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 January 17, 2008 by blademonkey ---"Educate the Mind, Make Savage the Body" -Mao Tse Tung
ChangMinYang Posted January 18, 2008 Posted January 18, 2008 _UserSID()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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now