How do you script the 'Paste GPO link' function using the Group Policy Administrator scripting inter (NETIQKB40776)

  • 7740776
  • 02-Feb-2007
  • 08-Sep-2008

Resolution

goal
How do you script the 'Paste GPO link' function using the Group Policy Administrator scripting interface?

fact
NetIQ Group Policy Administrator 5.0

fact
NetIQ Group Policy Administrator 4.0

fact
NetIQ Group Policy Administrator 4.5

fix

The ability to script the Paste GPO Link has been incorporated into Group Policy Administrator 4.5 (GPA) Scripting interface, however the documentation does not include examples of this method.  Below is a snippet of code on how to link a GPO in the Repository.

Linking a GPO

Link a GPO to a category.

Syntax

CategoryObject .LinkGPO ?GPOGUID?

Sample Code

Dim oGPRroot, oCategory

Set oGPRroot = Wscript.CreateObject("faGPRRoot.faGPRRoot")

oGPRroot.ConnectTo(?PROVIDER = SQLOLEDB.1;Integrated Security=SSPI;Initial Catalog=GPO_REPOSITORY;Data Source=MABOSLPT03;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=MABOSLPT03;Use Encryption for Data=False;Tag with column collation when possible=False?)

Set oCategory = oGPRroot.GetObject("FAGPR://CN=Desktop,DC=NetIQLabs,DC=com")

oCategory.CreateGPO "{31B2F340-016D-11D2-945F-00C04FB984F9}"



Additional Information

Formerly known as NETIQKB40776