Jump to content

Recommended Posts

Posted

I am trying to automate assigning custom names to my Windows ShellNew templates. Most are located in user SID hives that have a unique identifier number and, therefore, I can't write a registry script to modify them. Is there a way to acquire that registry key number with an Autoit script and then modify values under the key?

Posted

Is it the actual SID's that you are trying to get? Do you have the usernames to perform the lookups?

Something like this:

#include <Security.au3>

Local $sAccount = @UserName

Local $tSID = _Security__GetAccountSid($sAccount)
Local $sStringSID = _Security__SidToStringSid($tSID)

ConsoleWrite("User = " & $sAccount & @CRLF & "SID = " & $sStringSID & @CRLF)


Local $sAccount = 'NetworkService'

Local $tSID = _Security__GetAccountSid($sAccount)
Local $sStringSID = _Security__SidToStringSid($tSID)

ConsoleWrite("User = " & $sAccount & @CRLF & "SID = " & $sStringSID & @CRLF)


Local $sAccount = 'LocalService'

Local $tSID = _Security__GetAccountSid($sAccount)
Local $sStringSID = _Security__SidToStringSid($tSID)

ConsoleWrite("User = " & $sAccount & @CRLF & "SID = " & $sStringSID & @CRLF)


Local $sAccount = 'System'

Local $tSID = _Security__GetAccountSid($sAccount)
Local $sStringSID = _Security__SidToStringSid($tSID)

ConsoleWrite("User = " & $sAccount & @CRLF & "SID = " & $sStringSID & @CRLF)

 

If this is what you are looking for, you can substitute that for the registry values under HKEY_USERS. Permissions for some of these keys are a whole different ballgame though.

The Permissions UDF may be beneficial if needed.

 

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
  • Recently Browsing   0 members

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