IT tutorials
 
Windows
 

Windows 8 : Configuring User and Computer Policies - Working with Computer and User Script Policies

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
3/1/2013 11:47:29 AM

Script policies control the behavior and assignment of computer and user scripts. Four types of scripts can be configured:

  • Computer startup Executed during startup

  • Computer shutdown Executed prior to shutdown

  • User logon Executed when a user logs on

  • User logoff Executed when a user logs off

You can write these scripts as command-shell batch scripts, Windows scripts, or Windows PowerShell scripts. Batch scripts use the shell command language. Windows scripts use Windows Script Host (WSH) and are written in a scripting language such as Microsoft Visual Basic Scripting Edition (VBScript) or Microsoft JScript. Windows PowerShell scripts are written in the Windows PowerShell language. Note that policy preferences can in many cases eliminate the need to use computer and user scripts.

Controlling Script Behavior Through Policy

Policies that control script behavior are found under the Administrative Templates policies for Computer Configuration under System\Scripts and the Administrative Templates policies for User Configuration under System\Scripts. Through policy, you can control the behavior of startup, shutdown, logon, and logoff scripts. The key policies that you’ll use are described in Table 1. As you’ll see, there are numerous options for configuring script behavior.

Table 1. Computer and User Script Policies

POLICY TYPE

POLICY NAME

DESCRIPTION

Computer

Display Instructions In Shutdown Scripts As They Run

Displays shutdown scripts and their instructions as they execute.

Computer

Display Instructions In Startup Scripts As They Run

Displays startup scripts and their instructions as they execute.

Computer

Run Startup Scripts Asynchronously

Allows the system to run startup scripts simultaneously, rather than one at a time.

Computer

Run Windows PowerShell Scripts First At Computer Startup, Shutdown

Determines whether Windows PowerShell scripts are run before other types of scripts at startup and shutdown.

Computer

Specify Maximum Wait Time For Group Policy Scripts

Sets the maximum time to wait for scripts to finish running. The default value is 600 seconds (10 minutes).

Computer/User

Run Logon Scripts Synchronously

Ensures the system waits for logon scripts to finish before displaying the Windows interface.

Computer/User

Run Windows PowerShell Scripts First At User Logon, Logoff

Determines whether Windows PowerShell scripts are run before other types of scripts at logon and logoff.

User

Display Instructions In Logoff Scripts As They Run

Displays logoff scripts and their instructions as they execute.

User

Display Instructions In Logon Scripts As They Run

Displays logon scripts and their instructions as they execute.

User

Run Legacy Logon Scripts Hidden

Hides logon scripts configured through the System Policy Editor in Microsoft Windows NT 4.

Although you can control script behavior in many ways, you’ll usually want scripts to behave as follows:

  • Windows PowerShell scripts should run first.

  • Logon and startup scripts should run simultaneously (in most cases).

  • All scripts should be hidden rather than visible.

  • The system should wait no more than 1 minute for a script to complete (in most cases).

To enforce this behavior, follow these steps:

  1. Access Group Policy for the computer you want to work with. Next, access the Administrative Templates policies for Computer Configuration under System\Scripts.

  2. Double-tap or double-click Run Windows PowerShell Scripts First At Computer Startup, Shutdown. Select Enabled, and then tap or click OK.

  3. Double-tap or double-click Run Windows PowerShell Scripts First At User Logon, Logoff. Select Enabled, and then tap or click OK.

  4. Double-tap or double-click Run Logon Scripts Synchronously. Select Disabled, and then tap or click OK.

  5. Double-tap or double-click Run Startup Scripts Asynchronously. Select Enabled, and then tap or click OK.

  6. Double-tap or double-click Display Instructions In Startup Scripts As They Run. Select Disabled, and then tap or click OK.

  7. Double-tap or double-click Display Instructions In Shutdown Scripts As They Run. Select Disabled, and then tap or click OK.

  8. Double-tap or double-click Specify Maximum Wait Time For Group Policy Scripts. Select Enabled, and then enter a value of 60 for the wait time in the Seconds box. Tap or click OK.

  9. Access the Administrative Templates policies for User Configuration under System\Scripts.

  10. Double-tap or double-click Run Legacy Logon Scripts Hidden. Select Enabled, and then tap or click OK.

  11. Double-tap or double-click Display Instructions In Logon Scripts As They Run. Select Disabled, and then tap or click OK.

  12. Double-tap or double-click Display Instructions In Logoff Scripts As They Run. Select Disabled, and then tap or click OK.

  13. Double-tap or double-click Run Windows PowerShell Scripts First At User Logon, Logoff. Select Enabled, and then tap or click OK.

Assigning Computer Startup and Shutdown Scripts

Computer startup and shutdown scripts can be assigned as part of Group Policy. In this way, a computer and all its users—or all computers that are members of the site, domain, or OU—execute scripts automatically when they’re started or shut down.

To assign computer scripts, follow these steps:

  1. For easy management, copy the scripts you want to use to the Scripts\Startup or Scripts\Shutdown folder for the related policy. Scripts are stored in the %SystemRoot%\Sysvol\Sysvol\%UserDnsDomain%\Policies\GUID\Machine folder on domain controllers and %WinDir%\System32\GroupPolicy\Machine on workstations running Windows 8.

  2. Access the Group Policy console for the resource you want to work with. Then access policies for Computer Configuration under Windows Settings\Scripts.

  3. To work with startup scripts, press and hold or right-click Startup and then select Properties. To work with shutdown scripts, press and hold or right-click Shutdown and then select Properties. Next, tap or click Show Files. If you copied the computer scripts to the correct location, you should see the scripts you want to assign.

  4. Tap or click Add to assign a script. This opens the Add A Script dialog box. For the Script Name, type the name of a script you copied to the Scripts\Startup or the Scripts\Shutdown folder for the related policy. For the Script Parameters, enter any command-line arguments to pass to the command-line script or parameters to pass to the scripting host for a WSH script. Repeat this step to add other scripts.

  5. During startup or shutdown, scripts are executed in the order in which they’re listed in the Properties dialog box. Select a script name, then tap or click Up or Down to reposition the script as necessary.

  6. If you want to edit the script name or parameters later, select the script in the scripts list, and then tap or click Edit.

  7. To delete a script, select the script in the scripts list and then tap or click Remove.

Assigning User Logon and Logoff Scripts

User scripts can be assigned as part of Group Policy. In this way, all users who access a computer or are members of the site, domain, or OU execute scripts automatically when they log on or log off.

To assign user scripts, complete the following steps:

  1. Copy the scripts you want to use to the Scripts\Logon or the Scripts\Logoff folder for the related policy. User scripts are stored in the %SystemRoot%\Sysvol\Sysvol\%UserDnsDomain%\Policies\GUID\User folder on domain controllers and under %WinDir%\System32\GroupPolicy\User on workstations running Windows 8.

  2. Access the Group Policy console for the resource you want to work with. Then access policies for User Configuration under Windows Settings\Scripts.

  3. To work with logon scripts, press and hold or right-click Logon and then tap or click Properties. To work with logoff scripts, press and hold or right-click Logoff and tap or click Properties. Next, tap or click Show Files. If you copied the user scripts to the correct location, you should see the scripts you want to assign.

  4. Tap or click Add to assign a script. This opens the Add A Script dialog box. For the Script Name, type the name of a script you copied to the Scripts\Logon or the Scripts\Logoff folder for the related policy. For the Script Parameter, enter any command-line arguments to pass to the command-line script or parameters to pass to the scripting host for a WSH script. Repeat this step to add other scripts.

  5. During logon or logoff, scripts are executed in the order in which they’re listed in the Properties dialog box. Select a script name and tap or click Up or Down to reposition scripts as necessary.

  6. If you want to edit the script name or parameters later, select the script in the Scripts list, and then tap or click Edit.

  7. To delete a script, select the script in the Scripts list, and then tap or click Remove.

 
Others
 
- Managing Windows Small Business Server 2011 : Using Windows Server 2008 R2 Tools (part 2)
- Managing Windows Small Business Server 2011 : Using Windows Server 2008 R2 Tools (part 1)
- Windows 8 : Configuring User and Computer Policies - Working with Access and Connectivity Policies
- Windows 8 : Configuring User and Computer Policies - Working with File and Data Management Policies
- Windows Home Server 2011 : Configuring a Computer for Backup
- Windows Home Server 2011 : Converting Client Partitions to NTFS, Configuring Windows Home Server Backups
- Windows 8 : Configuring User and Computer Policies - Configuring Policies
- Windows 8 : Configuring User and Computer Policies - Group Policy Essentials
- Managing Windows Small Business Server 2011: Using Server Manager (part 2) - Adding Roles and Features
- Managing Windows Small Business Server 2011: Using Server Manager (part 1) - Managing Roles
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
Technology FAQ
- Is possible to just to use a wireless router to extend wireless access to wireless access points?
- Ruby - Insert Struct to MySql
- how to find my Symantec pcAnywhere serial number
- About direct X / Open GL issue
- How to determine eclipse version?
- What SAN cert Exchange 2010 for UM, OA?
- How do I populate a SQL Express table from Excel file?
- code for express check out with Paypal.
- Problem with Templated User Control
- ShellExecute SW_HIDE
programming4us programming4us