Microsoft KB Archive/825446

= How to Disable Certain FrontPage 2003 Commands by Using a GPO and a WSH Script =

Article ID: 825446

Article Last Modified on 8/9/2007

-

APPLIES TO


 * Microsoft Office FrontPage 2003
 * Microsoft Office FrontPage 2003
 * Microsoft Office FrontPage 2003
 * Microsoft Office FrontPage 2003
 * Microsoft Office FrontPage 2003
 * Microsoft Office FrontPage 2003

-





For a Microsoft FrontPage 2002 version of this article, see 324787.



IN THIS TASK
 SUMMARY Disable Certain FrontPage 2003 Commands by Using a GPO and a WSH Script 

Create the Sample Script

 

Copy the Sample Script to the Logon Scripts Folder of Your Default Domain Policy

 

Configure the Sample Script As the Logon Script

 

Test the Sample Script from a Client Computer

 Troubleshooting</li> REFERENCES</li></ul>

<div class="summary_section">

SUMMARY
This step-by-step article discusses how to turn off specific FrontPage 2003 commands for all Windows XP and Windows 2000 domain clients by using a sample Windows Script Host (WSH) script and a Group Policy object (GPO). When you use the sample script that is in this article, and you add it to the Default Domain policy, the FrontPage 2003 client cannot perform any of the following actions:
 * Formatting Options
 * Change themes
 * Insert Web components
 * Advanced Functions
 * Customize menu and toolbar commands
 * Run macros
 * Administrative Options
 * Change security settings
 * Change Web settings

Note This article discusses making Group Policy changes at the domain level. You must always test domain-level Group Policy settings in a test environment before you make changes to your domain.

back to the top

Disable Certain FrontPage 2003 Commands by Using a GPO and a WSH Script
To disable certain FrontPage 2003 commands by using a GPO and a WSH script, you must create the sample script. You must then copy the sample script to the logon scripts folder of the default domain policy, configure the sample script as the logon script, and then test the sample script from a client computer.

back to the top

Create the Sample Script
To create the sample script: <ol> Log on to your Windows domain controller as a user who is a member of the Domain Admins group.</li> Start Notepad, and then open a new document.</li>  Copy the following code, and then paste the code to the new document: Option Explicit

' Continue if errors occur On Error Resume Next

' declare our variables Dim objFP Dim objCommandBar Dim objControl

' ************************************************** ' This section checks to see if FrontPage is ' installed, and exits if it is not installed. ' **************************************************

' get a FrontPage Application object Set objFP = WScript.CreateObject(&quot;FrontPage.Application&quot;)

' exit if the object does not exist If Err.Number = -2147352567 Then WScript.Quit

' ************************************************** ' This section disables inserting Web components. ' **************************************************

' get the 'Insert' command bar Set objCommandBar = objFP.Application.CommandBars(&quot;Insert&quot;)

' get the 'Web Component' control Set objControl = objCommandBar.Controls(&quot;&Web Component...&quot;)

' disable it objControl.Enabled = False

' ************************************************** ' This section disables changing themes. ' **************************************************

' get the 'Format' command bar Set objCommandBar = objFP.Application.CommandBars(&quot;Format&quot;)

' get the 'Theme' control Set objControl = objCommandBar.Controls(&quot;T&heme...&quot;)

' disable it objControl.Enabled = False

' ************************************************** ' This section disables modifying the toolbars, changing ' Web settings or permissions, and running macros. ' **************************************************

' get the 'Tools' command bar Set objCommandBar = objFP.Application.CommandBars(&quot;Tools&quot;)

' get the 'Customize' control Set objControl = objCommandBar.Controls(&quot;&Customize...&quot;)

' disable it objControl.Enabled = False

' get the 'Web Settings' control Set objControl = objCommandBar.Controls(&quot;&Web Settings...&quot;)

' disable it objControl.Enabled = False

' get the 'Server' control Set objControl = objCommandBar.Controls(&quot;Ser&ver&quot;)

' disable it objControl.Enabled = False

' get the 'Macro' control Set objControl = objCommandBar.Controls(&quot;&Macro&quot;)

' disable it objControl.Enabled = False

' ************************************************** ' This section cleans up and exits. ' **************************************************

Set objFP = Nothing WScript.Quit </li> To save the file, follow these steps: <ol style="list-style-type: lower-alpha;"> On the File menu, click Save.</li> In the Save in box, click Desktop.</li> In the Save as type box, click All Files, type Sample.vbs in the File name box, and then click Save.</li></ol> </li> Quit Notepad.</li></ol>

back to the top

Copy the Sample Script to the Logon Scripts Folder of Your Default Domain Policy
To use the sample script with the Default Domain policy, determine the GUID for the GPO. Follow these steps: <ol> Log on to your Windows domain controller as a user who is a member of the Domain Admins group (if you are not already logged on).</li> Start Active Directory Users and Computers.</li> Right-click  , and then click Properties.</li> Click the Group Policy tab.</li> Click Default Domain Policy, and then click Properties.</li> Click the General tab.

Make a note of the GUID of the Default Domain policy. The GUID of the Default Domain policy is listed next to Unique name in the Summary area.</li> <li>Click Cancel, and then click Cancel.</li> <li>To use the sample script with the GPO, copy Sample.vbs from your desktop to the following folder on the hard disk, where is the fully qualified domain name (FQDN) of your domain (for example, MyDomain.local), and where   is the GUID number of the Default Domain policy.

%SystemRoot%\SYSVOL\sysvol\ \Policies\ \User\Scripts\Logon

</li></ol>

back to the top

Configure the Sample Script As a Logon Script
To configure the sample script as a logon script, follow these steps:
 * 1) Log on to your Windows domain controller as a user who is a member of the Domain Admins group (if you are not already logged on).
 * 2) Start Active Directory Users and Computers.
 * 3) Right-click  , and then click Properties.
 * 4) Click the Group Policy tab.
 * 5) Click Default Domain Policy, and then click Edit.
 * 6) In the left pane, under User Configuration, expand Windows Settings, and then click Scripts (Logon/Logoff).
 * 7) In the right pane, double-click Logon.
 * 8) Click Add.
 * 9) In the Script Name box, click Browse, locate Sample.vbs, click Sample.vbs, click Open, and then click OK.
 * 10) Click OK.
 * 11) Quit Group Policy Object Editor, and then quit Active Directory Users and Computers.

back to the top

Test the Sample Script from a Client Workstation
To test the sample script, follow these steps:
 * 1) Log on to a Windows XP-based client computer or log on to a Windows 2000-based client computer.

Note If you are already logged on to the computer, you must log off and then log back on again for the new Group Policy settings to apply to your computer.
 * 1) Start FrontPage 2003. If a new page is not automatically opened, click New on the File menu.
 * 2) Do the following:
 * 3) * On the Insert menu, verify that the Web Component command is unavailable.
 * 4) * On the Format menu, verify that the Theme command is unavailable.
 * 5) * On the Tools menu, verify that the Customize, the Macro, and the Server commands are unavailable.

back to the top

Troubleshooting
To troubleshoot issues that may occur, follow these steps:
 * 1) Retrace the steps in this article to make sure that the following conditions are true:
 * 2) * The syntax of the sample script is correct.
 * 3) * The sample script is copied to the correct Group Policy folder.
 * 4) * The sample script is added as a logon script, and it is not added as a logoff script, a startup script, or a shutdown script.
 * 5) Log off the client computer, and then log back on to update the Group Policy settings.
 * 6) Make sure that the client computer is a member of the domain where you added the logon script.

For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

250842 Troubleshooting Group Policy Application Problems

back to the top

<div class="references_section">