Tip

Active Directory scripting via GPOs

James Michael Stewart, Contributor

I'm often asked how to implement the execution of scripts within an Active Directory environment. Microsoft conveniently built script launching hooks into the group policy. Thus, as long as your client systems are Active Directory compliant, you can pre-configure scripts that are automatically launched.

The script controls are located in two different positions within a GPO. The first is under the Computer Configuration section, under Windows Settings, Scripts. The second is under the User Configuration section, also under Windows Settings, Scripts.

The script controls in the Computer Configuration section are used to define scripts that execute at startup (i.e. boot up) and shutdown (i.e. graceful shutdown). The script controls in the User Configuration section are used to define scripts that execute at logon and logoff.

All four controls use the same configuration interface dialog box. Through it you add or remove scripts and define their execution order. The most important scripts -- those which make critical changes to the system -- should be positioned to execute last. Scripts defined through the GPO run in sequential order. Thus, the second script will only launch once the first script completes its execution.

Once you've defined the scripts to execute at startup, shutdown, logon and logoff, the script files themselves are automatically transferred into the Active Directory database. This eliminates the need to define and maintain a network

Requires Free Membership to View

share for scripts manually. Instead, anywhere users can access Active Directory, they will also have access to the defined scripts.

Another great benefit to assigning scripts via AD's GPOs is that scripts can be uniquely tailored for each AD container: domain, site and organizational unit. Also, by setting read and deny access to GPOs on a container, you can designate the application of the GPO to certain users and groups.


James Michael Stewart is a researcher and writer for Lanwrights, Inc.


This was first published in September 2002

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.