Anonymous

Linking GPOs in a Script


LIKED BY
0
PEOPLE

Is there ANY way to use a VBScript - or anything else I could run automoatically - to make and remove GPO links? E.g., the GPO exists, I just need to link it to new OUs as they are created. I know how to create the OU in script, but not link a GPO. Win2003 domain, but we are moving to 2008R2 this quarter.

Replies

0

Linking existing GPO to an OU is just a matter of putting value in gPLink attribute on OU object. You can do this with any tool which will allow You to set attribute - just see how this attribute is filled with values (in case many GPOs are assigned to single OU). Here is VBscript example:

http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/usersgroups/ous/#AssignNewGPOLink.htm

 

You can also use GPMC interface, here is example:

http://www.leadfollowmove.com/archives/powershell/linking-a-gpo-using-gpmc-and-powershell

 

These are also POwershell cmdlets from Darren - You might want to take a look at it:

http://www.sdmsoftware.com/freeware.php

 

With R2 You will get GPO Powershell cmdlets:

http://technet.microsoft.com/en-us/library/dd367856%28WS.10%29.aspx

 

Planty of options ...