Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use a script to enable/disable GPO Links

Status
Not open for further replies.
Jan 16, 2003
4
0
0
US
I am trying to set up a scheduled task that will disable one GPO Link & enable a different GPO Link within the same OU. I understand that I need to use a script and have looked at the samples included with GPMC, but this stuff is over my head. I have found "IGPMGPOLink" in the GPMC Interfaces section of GPMC help (Manages a GPO link from a SOM. Sets and retrieves properties of GPO links, such as the link order or whether a link is enabled or enforced.). This appears to do exactly what I want it to do, but I have no idea how to use it.

Here is my OU layout:

<Domain Root>
<OU1>
<OU2>
<OU3>
<OU4>
<OU5>
<OU6>
<OU6a>
<OU6b>
<OU6c>
GPOLink GPOName=TestPolicy1
GPOLink GPOName=TestPolicy2
<OU7>
<OU8>
<OU9>
<OU9a>
<OU9b>
<OU10>


I need to disable the TestPolicy1 link & enable the TestPolicy2 link.

Can anybody help me with this?

Thanks,
LibraryDude
 
Out of curiosity ... why do you want to disable/enable GPO´s over the task scheduler?

Do you want different GPO´s to apply at different hours or what? Can you fill me in with some info about your scenario please? :)
 
Brain,

I have many public use internet stations that are locked down with a Centurion Guard device (returns the hard drive to it's original configuration when it is rebooted). I have disabled Windows Update via a group policy so they are not trying to update themselves every day (and the updates get wiped away when the PC is rebooted). I'd still like to be able to keep them updated on a regular basis & have set up a scheduled task that runs in the middle of the night that remotely unlocks the Centurion Guard which will allow any updates to stick after a reboot. Thus, I need a way to change the GPO to allow Windows Updates via our internal SUS server. I figured the easiest way would be to use a scheduled script to swap out the GPO with one that has Windows Update enabled, then swap it out again after allowing enough time for the updates to be applied. Once the updates have been applied, Task Scheduler then runs a batch file/script to relock the Centurion & reboot the PCs.

Hope this helps...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top