locked
How to import registry entry in Windows 7 through SCCM.. RRS feed

  • Question

  • Iam trying to import an registry key for a group of systems running with Windows 7 OS through SCCM. I created a batch file and advertised through SCCM. But even though SCCM report says successful, the registry is not getting imported. When we checked running the batch file locally, we found UAC is asking for validation before attempting to import the registry. If we run as adminstrator, the batch file works fine.

    Is there any way where we can incorpoate the run as administrator option or skip the UAC in SCCM for advertising this registry.

    Below is the entry we are trying to change.

    Windows Registry Editor Version 5.00

    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System]
    "DisableLockWorkstation"=dword:00000001

    And batch file is like,

    C:\> regedit /s <above registry key>

    TIA,

    Guru.R

    Tuesday, October 26, 2010 11:05 AM

Answers

  • I am sure that it was imported successfully, but not at the place where you expected it to appear. You most likely imported it to HKCU of "local system" (when running with admin rights). That's different from the currently logged in user.
    Why don't you use a GPO for setting that?
    Tuesday, October 26, 2010 11:40 AM

All replies

  • I am sure that it was imported successfully, but not at the place where you expected it to appear. You most likely imported it to HKCU of "local system" (when running with admin rights). That's different from the currently logged in user.
    Why don't you use a GPO for setting that?
    Tuesday, October 26, 2010 11:40 AM
  • Torsten is correct you will have better luck using a login script or GPO when trying to work with HKCU settings. SCCM runs as the local system account so making changes to HKCU is difficult, you'd have to run the package as the logged in user which means they need to have the correct permission to edit the registry in that location which is unlikely.

     


    John Marcum | http://myitforum.com/cs2/blogs/jmarcum |
    Tuesday, October 26, 2010 12:54 PM
  • Try using reg import <registry key> rather than regedit as it doesn't require UAC validation.

    Chris

    • Proposed as answer by Ronny uk Thursday, November 4, 2010 11:11 AM
    Thursday, November 4, 2010 11:09 AM
  • Try using reg import <registry key> rather than regedit as it doesn't require UAC validation.
    That won't help, because of the issue ("HKCU of the currently logged on use"r vs "HKCU of local system") I already mentioned above.
    Thursday, November 4, 2010 11:27 AM
  • I am trying to do a similar thing for a Windows 2008 R2 deployment. However the registry entries just don't seem to work. I've tried the above with limited success. I do understand that Registery Reflection may have a part to play in this due to it being a 64bit OS. Any suggestions? Thanks!
    Tuesday, July 5, 2011 2:19 PM
  •  Any suggestions? Thanks!
    Avoid double postings! See http://social.technet.microsoft.com/Forums/en-US/configmgrosd/thread/2a8cd835-81db-46ac-8ed5-538d8230f4e0/#8c80b680-ef75-4afe-87db-752859ac7553.
    Please add details. It does not help when you say "something similar". We need to know what you want to do exactly, what you have done already and which error codes have shown up.

    Torsten Meringer | http://www.mssccmfaq.de
    Tuesday, July 5, 2011 2:33 PM
  • I am having the same issue with trying to automate the installation of some REG keys. I don't understand why everyone that responded tried to say to do it a different way, IE: GPO. The question was is there a way to run as administrator in the batch file. Why can't he get a straight answer here??? Can you add this to a batch file or not? As I stated previously, I have the same question and would love to know if it is possible. I do NOT want someone telling me another way to do this with GPO's. You don't even know if the windows 7 machine is on a domain! Please help by answering this question by staying on topic.

    Thanks,

    Ryan

    Tuesday, August 14, 2012 7:42 PM
  • Ryan,

    As long as they are not current user settings you can do this very simply. If they are current user settings the only way you can do it is if the user has admin rights.

    Assuming they are not current user settings simply do a reg add command.

    either way, you do not need a bat file at all.

    If these are current user settings and the user does not have admin rights then no you can't use SCCM to do it.


    John Marcum | http://myitforum.com/cs2/blogs/jmarcum/|

    Tuesday, August 14, 2012 7:59 PM