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
markceliz09

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
Petey7

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
Neutron16

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
markceliz09

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
Neutron16

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
markceliz09

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
markceliz09

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
Thread Forum
An entry in registry missing
I want gain an access to com ports and require changed in registry entry of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\PNP0501 but it seems the folder is not there. I have tried regcleaner and reg fix did not help. thanks
Drivers
Can you copy a WinXP Pro registry entry into Win 7 registry
Hello, Background: 1. I have a program I use always, I have the install disks and can install it on Win 7 Pro x64. It is a 32 bit program. However, this program had a critical patch issued as a download way back when and this patch cannot be installed on the 7 system, because the installer is...
General Discussion
Registry Entry to delete specific User Profile entries
I work for a University as a Lab Manager where we have over 300 computers running Domain Profiles. We have begun updating from XP to 7 and started to notice TEMP profiles being created. I have figured out how to resolve the issue by going to the registry ...
General Discussion
Cannot delete Registry entry
After trying to recover from severe malware infection, I ran Spybot S&D. It removed several Registry entries but one it could not. I tried manually but it could not be removed. It is located at Hkey-users\S-1-5-21-200258984-2800820833-1255355968\Software\DataMngr. It has subdirectories "Files",...
System Security
User/SID doesn't appear in HKEY_USERS
Hi, I'm looking to add a key to a the HKEY_USERS hive through the reg command but when I run it I get an "invalid parameter" error. When I got to the HKEY_USERS hive I don't see the SID concerned however when I go to HKEY_LOCAL_MACHINE > SOFTWARE > MICROSOFT > WINDOWS NT > CurrentVersion >...
Performance & Maintenance
What is the strange registry entry and how can I delete it?
I have the following registry key that appears to do nothing but keeps re-creating itself: HKEY_CURRENT_USER\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon This key contains a Shell value that points to an empty directory on my system: C:\Users\Birk\AppData\Local\bc53345c\X If I...
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 00:21.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App