Microsoft KB Archive/324787

= HOW TO: Disable FrontPage 2002 Commands by Using a GPO and a WSH Script =

Article ID: 324787

Article Last Modified on 2/1/2007

-

APPLIES TO

 Microsoft FrontPage 2002 Standard Edition, when used with:  Microsoft Windows XP Professional

 Microsoft Windows 2000 Professional Edition

 Microsoft Windows 2000 Server

 Microsoft Windows 2000 Advanced Server</li></ul> </li></ul>

-

<div class="notice_section">

This article was previously published under Q324787

<div class="notice_section">

IN THIS TASK
SUMMARY
 * Step 1: Create the Sample Script
 * Step 2: Copy the Sample Script to Your Default Domain Policy's Logon Scripts Folder
 * Step 3: Configure the Sample Script as a Logon Script
 * Step 4: Test the Sample Script from a Client Workstation
 * Step 5: Perform Troubleshooting

REFERENCES (back to top)

<div class="summary_section">

SUMMARY
This step-by-step article shows you how to turn off (disable) specific Microsoft FrontPage 2002 commands for all Microsoft Windows 2000 and Microsoft Windows XP domain clients by using a sample Windows Script Host (WSH) script and a Group Policy object (GPO). Using the sample code in this article, you can disable the following functionality in the FrontPage 2002 client: Formatting Options:
 * Changing Themes
 * Inserting Web Components

Advanced Functions:
 * Customizing Command Bars
 * Running Macros

Administrative Options:
 * Changing Security Permissions
 * Changing Web Settings

NOTE: This article discusses making Group Policy changes at the domain level. Always test domain-level Group Policy settings in a lab environment before making changes to your domain.

(back to top)

Step 1: Create the Sample Script
<ol> Log on to your Windows domain controller as a Domain Admin.</li> Open Notepad.

To do this, click Start, click Run, type notepad in the Open box, and then click OK.</li>  Type or paste the following WSH code into Notepad: 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> Save the file: <ol style="list-style-type: lower-alpha;"> On the File menu, click Save.</li> In the Save in box, click Desktop.</li> In the File name box, type Sample.vbs, and then click Save.</li></ol> </li> On the File menu, click Exit to close Notepad.</li></ol>

(back to top)

Step 2: Copy the Sample Script to Your Default Domain Policy's Logon Scripts Folder
To use the sample script with the Default Domain policy, determine the globally unique identifier (GUID) for the GPO. To do this, follow these steps:
 * 1) If you have not done so already, log on to your Windows domain controller as a Domain Admin.
 * 2) Start the Active Directory Users and Computers snap-in in Microsoft Management Console (MMC). To do this, click Start, point to Programs (or All Programs), point to Administrative Tools, and then click Active Directory Users and Computers.
 * 3) Right-click your domain, then click Properties.
 * 4) Click the Group Policy tab.
 * 5) Click Default Domain Policy, and then click Properties.

The GUID number for the Default Domain policy is listed as the Unique name property in the Summary section.
 * 1) Click Cancel to close the GPO Properties dialog box.
 * 2) Click Cancel to close the Domain Properties dialog box.

To use the sample script with the GPO, copy Sample.vbs from your desktop to the following folder

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

where  is the fully qualified domain name (FQDN) of your domain (for example, mydomain.local), and   is the GUID number for the Default Domain policy.

(back to top)

Step 3: Configure the Sample Script as a Logon Script

 * 1) If you have not done so already, log on to your Windows domain controller as a Domain Admin.
 * 2) Start the Active Directory Users and Computers snap-in in MMC. To do this, click Start, point to Programs (or All Programs), point to Administrative Tools, and then click Active Directory Users and Computers.
 * 3) Right-click your domain, and then click Properties.
 * 4) Click the Group Policy tab.
 * 5) Click Default Domain Policy, and then click Edit.
 * 6) In the console tree, expand Windows Settings under User Configuration, and then click Scripts (Logon/Logoff).
 * 7) In the right pane, double-click Logon.
 * 8) Click Add.
 * 9) Click Browse.
 * 10) Click Sample.vbs, and then click Open.
 * 11) Click OK to add the script.
 * 12) Click OK to close the Logon dialog box.
 * 13) Close Group Policy Object Editor.
 * 14) Click OK to close the Domain Properties dialog box.

(back to top)

Step 4: Test the Sample Script from a Client Workstation

 * 1) Log on to a client workstation that runs Windows 2000 or Windows XP.

NOTE: If you were already logged on the client workstation, log off and then log back on again for the new Group Policy settings to be applied.
 * 1) Start FrontPage 2002.
 * 2) If a page is not automatically opened, click New Page on the FrontPage 2002 tool bar.
 * 3) Verify that the Web Component command is unavailable (that is, appears dimmed) on the Insert menu.
 * 4) Verify that the Theme command is unavailable on the Format menu.
 * 5) Verify that the Customize command, Web Settings command, Server command, and Macro command are unavailable on the Tools menu.

(back to top)

Step 5: Perform Troubleshooting
To troubleshoot any problems, follow these steps: <ol> Retrace the steps in this article to make sure that <ol style="list-style-type: lower-alpha;"> The sample script's syntax is correct.</li> The sample script was copied to the correct Group Policy folder.</li> The sample script was added as a logon script (for example, it was not added as a logoff script, startup script, or shutdown script).</li></ol> </li> Make sure that you log off the client workstation and log back on to refresh the Group Policy settings.</li> Make sure that the client workstation is part of the domain to which you added the logon script.</li></ol>

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

250842 Troubleshooting Group Policy Application Problems

(back to top)

<div class="references_section">