none
Unable to set Internet Explorer Home Page using PowerShell DSC RRS feed

  • Question

  • Hi Everyone

    I'm trying to set IE 11 Homepage(in windows 10) using PowerShell DSC. I'm using below code:

    	#Sets Internet Exploerer Home Page
    		Registry SetIEHomePage
            {
            Ensure      = "Present"
            Key         = "HKEY_Local_Machine\Software\Microsoft\Internet Explorer\Main"
            ValueName   = "Start Page"
            ValueData   = "http://localhost:5050"
            }
    		Registry SetIESecondaryPage
            {
            Ensure      = "Present"
            Key         = "HKEY_Local_Machine\Software\Microsoft\Internet Explorer\Main"
            ValueName   = "Secondary Start Pages"
            ValueData   = "http://localhost:5052"
            }

    However, it does not same page. Below is the output from runtime:

    VERBOSE: [WIN10]: LCM:  [ Start  Resource ]  [[Registry]SetIEHomePage]
    VERBOSE: [WIN10]: LCM:  [ Start  Test     ]  [[Registry]SetIEHomePage]
    VERBOSE: [WIN10]:                            [[Registry]SetIEHomePage] Found registry key value 'HKLM:\Software\Microsoft\Internet Explorer\Main\Start Page' with type 'String' and data 'http://localhost:5050'
    VERBOSE: [WIN10]: LCM:  [ End    Test     ]  [[Registry]SetIEHomePage]  in 0.2870 seconds.
    VERBOSE: [WIN10]: LCM:  [ Skip   Set      ]  [[Registry]SetIEHomePage]
    VERBOSE: [WIN10]: LCM:  [ End    Resource ]  [[Registry]SetIEHomePage]
    VERBOSE: [WIN10]: LCM:  [ Start  Resource ]  [[Registry]SetIESecondaryPage]
    VERBOSE: [WIN10]: LCM:  [ Start  Test     ]  [[Registry]SetIESecondaryPage]
    VERBOSE: [WIN10]:                            [[Registry]SetIESecondaryPage] Found registry key value 'HKLM:\Software\Microsoft\Internet Explorer\Main\Secondary Start Pages' with type 'String' and data 'http://localhost:5052'
    VERBOSE: [WIN10]: LCM:  [ End    Test     ]  [[Registry]SetIESecondaryPage]  in 0.0310 seconds.
    VERBOSE: [WIN10]: LCM:  [ Skip   Set      ]  [[Registry]SetIESecondaryPage]
    VERBOSE: [WIN10]: LCM:  [ End    Resource ]  [[Registry]SetIESecondaryPage]

    I also tried using Key HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main to no help. Please advise.


    Thanks
    Mohit


    • Edited by mohit.goyal Thursday, June 29, 2017 10:41 AM
    Thursday, June 29, 2017 10:40 AM

Answers

  • You cannot use DSC to adjust a user.  Home page is per-user and in the users hive.  CURRENT_USER only exists when a user is logged in.

    This can be set with Group Policy or via the IEAK.


    \_(ツ)_/

    • Marked as answer by mohit.goyal Thursday, June 29, 2017 11:00 AM
    Thursday, June 29, 2017 10:53 AM

All replies

  • You cannot use DSC to adjust a user.  Home page is per-user and in the users hive.  CURRENT_USER only exists when a user is logged in.

    This can be set with Group Policy or via the IEAK.


    \_(ツ)_/

    • Marked as answer by mohit.goyal Thursday, June 29, 2017 11:00 AM
    Thursday, June 29, 2017 10:53 AM
  • Ohh..okay. Thanks for information jrv.

    Thanks
    Mohit

    Thursday, June 29, 2017 11:00 AM
  • Hi Jrv

    I earlier came across https://gallery.technet.microsoft.com/scriptcenter/How-to-set-Internet-2473469c which talks about the same and that gave me idea of using registry keys. Can you once again confirm that it does not work? Also, shouldn't current user settings be based on what is configured in HKLM?


    Thanks
    Mohit


    • Edited by mohit.goyal Thursday, June 29, 2017 11:27 AM
    Thursday, June 29, 2017 11:25 AM
  • Hi mohit

    About registry: if the settings are for something which is different from user to user, then it is stored in the HKCU. If its over the entire system, it's configured in the HKLM. 

    About the script: I don't know if the script modifies the HKLM or the HKCU registry part, but if it changes the registry for the current user, it could work. If it changes the HKLM, it won't work. 

    Thursday, June 29, 2017 11:39 AM
  • Ok..that's good to know. I tried with HKCU as well, but it don't work. I guess I need to start looking for options other than DSC.

    Thanks
    Mohit

    Thursday, June 29, 2017 11:42 AM
  • The DSC module only sets a new default for the machine and will not override the users settings.  It just sets what a new user profile will see initially.  It does not refer to the HKCU hive anywhere. All operations are on HKLM and effect the keys used to initialize a new user profile.

    Use Group Policy.   DSC does not eliminate GP.  You can also use SCCM to configure users.  DSC is not a substitute or replacement for GP.  In the future I suspect the DSC will be used by GP for machine level settings as it is more flexible and, possibly, more secure.


    \_(ツ)_/

    Thursday, June 29, 2017 11:58 AM