A.0 Automating GPA Operations with .NET

To make your policy administration easier, you can schedule Group Policy Administrator (GPA) to perform backups or imports regularly using Microsoft Scheduled Tasks by creating scripts or .NET applications as documented in this section.

GPA has packaged all the functionality associated with policy management and provided it as a COM .DLL file, enabling it to be scripted. GPA also supports PowerShell and .NET language applications to automate group policy administration. This feature abstracts the complex ADSI concepts related to Group Policy, which saves you time and effort in coding. The Microsoft Windows Script Host enables you to run scripts directly on any computer running the GPA Console by either:

  • Clicking a script file on the Microsoft Windows desktop

  • Typing the name of a script file at the command prompt

You can also create .NET applications and schedule them to run automatically. The biggest benefit of this GPA feature for administrators is the simplicity and ease of programming. You can use any text editor, such as Notepad, to create the Visual Basic scripts with minimal programming effort. This section provides information for writing Visual Basic scripts and C# methods.

NOTE:

  • Because the width of some commands is too long for the width of this page, many of the command lines run over to a second or third line. When you create a script or method, only include line breaks where the extra space appears between paragraphs in this document.

  • If you are running GPA on a 64‑bit platform, you need to run scripts and .NET applications using a 32‑bit command prompt window. On a 64‑bit computer, you can access the 32‑bit command prompt window from the %WINDIR%\SysWOW64 folder.