none
Registry Keys in Windows 7 for Group Policy

    Question

  • Hi,

    I am trying to configure logoff scripts for a user in Windows 7 standalone system. I used the below registry key on windows xp and it worked fine.

          <RegistryValue Action="write" Id="CreateScript" Root="HKCU"
                    Key="Software\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Logoff\0\0"
                    Name="Script" Type="string" Value="C:\Pms\Bin\Logoff.cmd" />

    How to achieve the same on Windows 7 ? I am creating a msi using wix and this msi will install the group policy registry keys. 

    Friday, September 07, 2012 9:47 AM

Answers

  • This si a scripting forum.  YOU need to ask your question in a forum for Wix of for Microsft Installer.

    The text you are printing is XML snippets.  They are not script.


    ¯\_(ツ)_/¯

    Friday, September 07, 2012 3:14 PM

All replies

  • Couldn't you drop it in this folder and avoid the tattoo in the registry ?  W7 should run any script in this folder by default.

    C:\Windows\System32\GroupPolicy\User\Scripts\Logoff

    Don't forget to mark your posts as answered so they drop off the unanswered post filter. If I've helped you and you want to show your gratitude, just click that green thingy.


    Friday, September 07, 2012 9:55 AM
  • Will try your solution and update. Thank you.
    Friday, September 07, 2012 10:23 AM
  • I have other following operations performed before setting the logoff script and how can I do the same on windows 7.

    <RegistryKey Action="createAndRemoveOnUninstall" Id="CreateHistorySubFolder" Root="HKCU"
                       Key="Software\Microsoft\Windows\CurrentVersion\Group Policy\History\{42B5FAAE-6536-11D2-AE5A-0000F87571E3}" />
          <RegistryKey Action="createAndRemoveOnUninstall" Id="CreateHistorySubFolder0" Root="HKCU"
                       Key="Software\Microsoft\Windows\CurrentVersion\Group Policy\History\{42B5FAAE-6536-11D2-AE5A-0000F87571E3}\0" />
          <RegistryValue Action="write" Id="CreateOptions" Root="HKCU"
                    Key="Software\Microsoft\Windows\CurrentVersion\Group Policy\History\{42B5FAAE-6536-11D2-AE5A-0000F87571E3}\0"
                    Name="Options" Type="integer" Value="0" />
          <RegistryValue Action="write" Id="CreateVersion" Root="HKCU"
                    Key="Software\Microsoft\Windows\CurrentVersion\Group Policy\History\{42B5FAAE-6536-11D2-AE5A-0000F87571E3}\0"
                    Name="Version" Type="integer" Value="131074"/>
          <RegistryValue Action="write" Id="CreateDSPath" Root="HKCU"
                    Key="Software\Microsoft\Windows\CurrentVersion\Group Policy\History\{42B5FAAE-6536-11D2-AE5A-0000F87571E3}\0"
                    Name="DSPath" Type="string" Value="LocalGPO" />
          <RegistryValue Action="write" Id="CreateFileSysPath" Root="HKCU"
                    Key="Software\Microsoft\Windows\CurrentVersion\Group Policy\History\{42B5FAAE-6536-11D2-AE5A-0000F87571E3}\0"
                    Name="FileSysPath" Type="string" Value="C:\Windows\System32\GroupPolicy\User" />
          <RegistryValue Action="write" Id="CreateExtensions" Root="HKCU"
                    Key="Software\Microsoft\Windows\CurrentVersion\Group Policy\History\{42B5FAAE-6536-11D2-AE5A-0000F87571E3}\0"
                    Name="Extensions" Type="string" Value="[\[]{42B5FAAE-6536-11D2-AE5A-0000F87571E3}{40B66650-4972-11D1-A7CA-0000F87571E3}[\]]" />
          <RegistryValue Action="write" Id="CreatelParam" Root="HKCU"
                    Key="Software\Microsoft\Windows\CurrentVersion\Group Policy\History\{42B5FAAE-6536-11D2-AE5A-0000F87571E3}\0"
                    Name="lParam" Type="integer" Value="0" />
          <RegistryValue Action="write" Id="CreateLink" Root="HKCU"
                    Key="Software\Microsoft\Windows\CurrentVersion\Group Policy\History\{42B5FAAE-6536-11D2-AE5A-0000F87571E3}\0"
                    Name="Link" Type="string" Value="Local" />
          <RegistryValue Action="write" Id="CreateGPOName" Root="HKCU"
                    Key="Software\Microsoft\Windows\CurrentVersion\Group Policy\History\{42B5FAAE-6536-11D2-AE5A-0000F87571E3}\0"
                    Name="GPOName" Type="string" Value="Local Group Policy" />
          <RegistryValue Action="write" Id="CreateGPOLink" Root="HKCU"
                    Key="Software\Microsoft\Windows\CurrentVersion\Group Policy\History\{42B5FAAE-6536-11D2-AE5A-0000F87571E3}\0"
                    Name="GPOLink" Type="integer" Value="1" />
          <RegistryValue Action="write" Id="CreateDisplayName" Root="HKCU"
                    Key="Software\Microsoft\Windows\CurrentVersion\Group Policy\History\{42B5FAAE-6536-11D2-AE5A-0000F87571E3}\0"
                    Name="DisplayName" Type="string" Value="Local Group Policy" />

          <RegistryKey Action="createAndRemoveOnUninstall" Id="CreateScriptsLogoff" Root="HKCU"
                    Key="Software\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Logoff" />
          <RegistryKey Action="createAndRemoveOnUninstall" Id="CreateScriptsLogoff0" Root="HKCU"
                    Key="Software\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Logoff\0" />
          <RegistryValue Action="write" Id="CreateGPOID0" Root="HKCU"
                    Key="Software\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Logoff\0"
                    Name="GPO-ID" Type="string" Value="LocalGPO" />
          <RegistryValue Action="write" Id="CreateSOMID0" Root="HKCU"
                    Key="Software\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Logoff\0"
                    Name="SOM-ID" Type="string" Value="Local"/>
          <RegistryValue Action="write" Id="CreateFileSysPath0" Root="HKCU"
                    Key="Software\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Logoff\0"
                    Name="FileSysPath" Type="string" Value="C:\Windows\System32\GroupPolicy\User" />
          <RegistryValue Action="write" Id="CreateDisplayName0" Root="HKCU"
                    Key="Software\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Logoff\0"
                    Name="DispalyName" Type="string" Value="Local Group Policy" />
          <RegistryValue Action="write" Id="CreatePSScriptOrder0" Root="HKCU"
                    Key="Software\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Logoff\0"
                    Name="PSScriptOrder" Type="integer" Value="1" />
          <RegistryValue Action="write" Id="CreateGPONameLogoff" Root="HKCU"
                    Key="Software\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Logoff\0"
                    Name="GPOName" Type="string" Value="Local Group Policy" />
          <RegistryKey Action="createAndRemoveOnUninstall" Id="CreateScriptsLogoff00" Root="HKCU"
                    Key="Software\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Logoff\0\0"/>
          <RegistryValue Action="write" Id="CreateScript" Root="HKCU"
                    Key="Software\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Logoff\0\0"
                    Name="Script" Type="string" Value="C:\Pms\Bin\Logoff.cmd" />
          <RegistryValue Action="write" Id="CreateParameters" Root="HKCU"
                    Key="Software\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Logoff\0\0"
                    Name="Parameters" Type="string" Value="" />
          <RegistryValue Action="write" Id="CreateIsPowershell" Root="HKCU"
                    Key="Software\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Logoff\0\0"
                    Name="IsPowershell" Type="integer" Value="0" />
          <RegistryValue Action="write" Id="CreateExecTime" Root="HKCU"
                    Key="Software\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Logoff\0\0"
                    Name="ExecTime" Type="integer" Value="0" />

          <RegistryKey Action="createAndRemoveOnUninstall" Id="CreateScriptsLogon" Root="HKCU"
                    Key="Software\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Logon" />
        </Component>

    Also, I have gpt.ini file installed under c:/windows/system32/grouppolicy folder and below is the content of gpt.ini file.

    [General]
    gPCUserExtensionNames=[{42B5FAAE-6536-11D2-AE5A-0000F87571E3}{40B66650-4972-11D1-A7CA-0000F87571E3}]
    Version=131072

    Do i need to modify user extensions (42B5FAAE-6536-11D2-AE5A-0000F87571E3) in above code to suit for windows 7 ?

    Friday, September 07, 2012 11:03 AM
  • This si a scripting forum.  YOU need to ask your question in a forum for Wix of for Microsft Installer.

    The text you are printing is XML snippets.  They are not script.


    ¯\_(ツ)_/¯

    Friday, September 07, 2012 3:14 PM