Configure Local GPE state from Powershell script

Welcome Forums General PowerShell Q&A Configure Local GPE state from Powershell script

This topic contains 2 replies, has 3 voices, and was last updated by

4 years, 8 months ago.

  • Author
  • #18466

    Topics: 3
    Replies: 2
    Points: 0
    Rank: Member

    Hi All,

    in Windows server 2008 r2 , for this manual process

    open run >gpedit.msc > computer configuration > windows templates > windows update > specify intranet microsoft update service location > and also state should be enabled.

    May i know how to do this from powershell script.

    Thanks in Advance

  • #18471

    Topics: 13
    Replies: 4872
    Points: 1,811
    Helping HandTeam Member
    Rank: Community Hero

    Those settings are entirely in the registry. You could probably open the ADM/ADMX file to see specifically where in the registry, and you could certainly use PowerShell's registry drives (HKCU: and HKLM:) to modify the appropriate registry keys. I don't personally know where those settings are in the registry – you would need to research that. would be a good place to start – I believe it lists the keys you are looking for.

  • #18476

    Topics: 9
    Replies: 2322
    Points: 0
    Rank: Member

    When you modify a setting that's under "Administrative Templates" in the group policy editor, it gets stored in a file called registry.pol in the GPO's folder. Assigning those settings directly in the registry has a similar effect as far as the system's behavior is concerned, but you won't see the changes in the Group Policy console.

    There's no built-in way to modify these registry.pol files from a script or command line in a local GPO, but I wrote some C# code to work with them a while back: . (Fair warning: it's kind of ugly, but it works. I didn't have much experience with C# or PowerShell when I wrote it.)

The topic ‘Configure Local GPE state from Powershell script’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort