Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: How do I add Registry entry under HKEY_USERS\ for the current user


15 Dec 2011   #1

Windows 7 Professional x86
 
 
How do I add Registry entry under HKEY_USERS\ for the current user

Hi,

How can I add a registry entry under HKEY_USERS for the current user? I already have the registry entry imported from my account, but my problem is it won't work with other accounts because we have different SID for HKEY_USERS. Please help me on this.

Thanks!


My System SpecsSystem Spec
.

15 Dec 2011   #2

Windows 7 Professional SP1 64-bit
 
 

Maybe you should give us a more detailed explanation of exactly what you are trying to do. Your question does not tell us much and without understanding exactly what you are doing, it will be more difficult to help.
My System SpecsSystem Spec
15 Dec 2011   #3

Windows 8.1 ; Windows 7 x86 (Dec2008-Jan2013)
 
 

Let's say your current user name is MARK.

Then you copy the following code
Code:
$objUser = New-Object System.Security.Principal.NTAccount("MARK") 
$strSID = $objUser.Translate([System.Security.Principal.SecurityIdentifier]) 
$strSID.Value
open Windows PowerShell and right click in it's command window (should work as Paste command), then hit Enter.
It will show you SID for user named Mark.

Then you need to edit reg file in Notepad and substitute SID with a correct one (You can export reg file from Regedit if required and then import back edited one).

BUT first BACKUP your data+registry!

It works other way around too. You can find a username by SID:
Code:
$objSID = New-Object System.Security.Principal.SecurityIdentifier ` 
    ("S-1-5-21-1454471165-1004335555-1606985555-5555") 
$objUser = $objSID.Translate( [System.Security.Principal.NTAccount]) 
$objUser.Value
My System SpecsSystem Spec
.


16 Dec 2011   #4

Windows 7 Professional x86
 
 

Quote   Quote: Originally Posted by Petey7 View Post
Maybe you should give us a more detailed explanation of exactly what you are trying to do. Your question does not tell us much and without understanding exactly what you are doing, it will be more difficult to help.

Sorry for giving such a short description of my problem.

So here's the scenario, were are going to deploy Fortinet SSL VPN client to all our laptops here in our company. We have no problem in installing the Fortinet client, the problem is we have to pre-configured the settings in it. I found out that the settings are stored in the registry, so what I did is I configured my Fortinet client then exported the registry keys of the settings. I tried logging in into another computer with fortinet client but no configurations yet. I merged the .reg file I imported and I was able to pre-configured the fortinet client. The problem here is the registry keys I imported has my SID and when I imported it using a different account, it would not take effect or even have errors because I using a different SID.

Here's the key I imported:

[HKEY_USERS\S-1-5-21-3810145928-4034201778-1548147441-1606\Software\Fortinet\SslvpnClient\Tunnels]

My objective here is how can I change the SID(those in red) to the current SID of the user when I merge the .reg file I exported. Would it be possible?

Hope this is clear enough.

Thanks!
My System SpecsSystem Spec
16 Dec 2011   #5

Windows 8.1 ; Windows 7 x86 (Dec2008-Jan2013)
 
 

From your user you should have exported the key
HKEY_CURRENT_USER\Software\Fortinet\SslvpnClient\Tunnels
which would be "virtual" key of current logged user (it has no data, it just links to current logged user).

If you export that thread from your computer, you can import in at any computer without messing with SIDs.

So, make another master reg file or edit existing replacing
HKEY_USERS\S-1-5-21-3810145928-4034201778-1548147441-1606\Software\Fortinet\SslvpnClient\Tunnels
with
HKEY_CURRENT_USER\Software\Fortinet\SslvpnClient\Tunnels
My System SpecsSystem Spec
16 Dec 2011   #6

Windows 7 Professional x86
 
 

Quote   Quote: Originally Posted by Neutron16 View Post
From your user you should have exported the key
HKEY_CURRENT_USER\Software\Fortinet\SslvpnClient\Tunnels
which would be "virtual" key of current logged user (it has no data, it just links to current logged user).

If you export that thread from your computer, you can import in at any computer without messing with SIDs.

So, make another master reg file or edit existing replacing
HKEY_USERS\S-1-5-21-3810145928-4034201778-1548147441-1606\Software\Fortinet\SslvpnClient\Tunnels
with
HKEY_CURRENT_USER\Software\Fortinet\SslvpnClient\Tunnels

Hi,

yes, I also thought of it, but per checking with the registry, there is no [HKEY_USERS\Software\Fortinet\SslvpnClient\Tunnels], only [HKEY_USERS\Software\Fortinet\SslvpnClient]. How can I create a new key for Tunnels?
My System SpecsSystem Spec
16 Dec 2011   #7

Windows 7 Professional x86
 
 

Hi,

I was able to find the commandline on adding registry keys for the current users through DOS.

Here's the command line:
reg add HKEY_CURRENT_USER\Software\Fortinet\SslvpnClient\Tunnels

Problem now is ordinary users are not allowed to edit the Registry so I have to open an Elevated Command Prompt through run As, then run the commandline. It is successful, but it will add the configuration for the Administrator user that I used to open the command prompt.

How can I apply the change for all users? Is it possible?
My System SpecsSystem Spec
Reply

 How do I add Registry entry under HKEY_USERS\ for the current user




Thread Tools



Similar help and support threads for2: How do I add Registry entry under HKEY_USERS\ for the current user
Thread Forum
Default program registry entry Software
Solved Unable to delete empty registry entry General Discussion
Cannot delete Registry entry System Security
User/SID doesn't appear in HKEY_USERS Performance & Maintenance
Solved What is the strange registry entry and how can I delete it? Software

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 11:13 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33