HOW TO: Disable FrontPage 2002 Commands by Using a GPO and a WSH Script (324787)
The information in this article applies to:
- Microsoft FrontPage 2002, when used with:
- Microsoft Windows XP Professional
- Microsoft Windows 2000 Professional
- Microsoft Windows 2000 Server
- Microsoft Windows 2000 Advanced Server
This article was previously published under Q324787 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- Log on to your Windows domain controller as a Domain
Admin.
- Open Notepad.
To do this, click Start, click Run, type notepad in the Open box, and then click OK. - 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("FrontPage.Application")
' 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("Insert")
' get the 'Web Component' control
Set objControl = objCommandBar.Controls("&Web Component...")
' disable it
objControl.Enabled = False
' **************************************************
' This section disables changing themes.
' **************************************************
' get the 'Format' command bar
Set objCommandBar = objFP.Application.CommandBars("Format")
' get the 'Theme' control
Set objControl = objCommandBar.Controls("T&heme...")
' 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("Tools")
' get the 'Customize' control
Set objControl = objCommandBar.Controls("&Customize...")
' disable it
objControl.Enabled = False
' get the 'Web Settings' control
Set objControl = objCommandBar.Controls("&Web Settings...")
' disable it
objControl.Enabled = False
' get the 'Server' control
Set objControl = objCommandBar.Controls("Ser&ver")
' disable it
objControl.Enabled = False
' get the 'Macro' control
Set objControl = objCommandBar.Controls("&Macro")
' disable it
objControl.Enabled = False
' **************************************************
' This section cleans up and exits.
' **************************************************
Set objFP = Nothing
WScript.Quit
- Save the file:
- On the File menu, click Save.
- In the Save in box, click Desktop.
- In the File name box, type
Sample.vbs, and then click Save.
- On the File menu, click Exit to close Notepad.
( 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:
- If you have not done so already, log on to your Windows
domain controller as a Domain Admin.
- 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.
- Right-click your domain, then click Properties.
- Click the Group Policy tab.
- 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. - Click Cancel to close the GPO Properties dialog box.
- 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\DOMAIN\Policies\GUID\USER\Scripts\Logon
where DOMAIN is the fully qualified
domain name (FQDN) of your domain (for example, mydomain.local), and
GUID is the GUID number for the Default Domain
policy. ( back to top) Step 3: Configure the Sample
Script as a Logon Script- If you have not done so already, log on to your Windows
domain controller as a Domain Admin.
- 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.
- Right-click your domain, and then click Properties.
- Click the Group Policy tab.
- Click Default Domain Policy, and then click Edit.
- In the console tree, expand Windows Settings under User Configuration, and then click Scripts (Logon/Logoff).
- In the right pane, double-click Logon.
- Click Add.
- Click Browse.
- Click Sample.vbs, and then click Open.
- Click OK to add the script.
- Click OK to close the Logon dialog box.
- Close Group Policy Object Editor.
- Click OK to close the Domain Properties dialog box.
( back to top) Step 4: Test the Sample Script
from a Client Workstation- 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. - Start FrontPage 2002.
- If a page is not automatically opened, click New Page on the FrontPage 2002 tool bar.
- Verify that the Web Component command is unavailable (that is, appears dimmed) on the Insert menu.
- Verify that the Theme command is unavailable on the Format menu.
- 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:
- Retrace the steps in this article to make sure that
- The sample script's syntax is correct.
- The sample script was copied to the correct Group
Policy folder.
- The sample script was added as a logon script (for
example, it was not added as a logoff script, startup script, or shutdown
script).
- Make sure that you log off the client workstation and log
back on to refresh the Group Policy settings.
- Make sure that the client workstation is part of the domain
to which you added the logon script.
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) REFERENCESFor additional information, click the article numbers below to
view the articles in the Microsoft Knowledge Base: 309136 HOW TO: Disable a Custom Menu Command and Toolbar Button by Using a System Policy Setting in Office XP
309312 HOW TO: Configure a Policy Setting to Disable Password Protection for Microsoft Access 2002, Microsoft Excel 2002, and Microsoft Word 2002
322241 HOW TO: Assign Scripts in Windows 2000
Modification Type: | Major | Last Reviewed: | 2/9/2006 |
---|
Keywords: | kbhowto kbHOWTOmaster KB324787 |
---|
|