Microsoft KB Archive/324787

From BetaArchive Wiki

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



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

  1. Log on to your Windows domain controller as a Domain Admin.
  2. Open Notepad.

    To do this, click Start, click Run, type notepad in the Open box, and then click OK.
  3. 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
                        
  4. Save the file:
    1. On the File menu, click Save.
    2. In the Save in box, click Desktop.
    3. In the File name box, type Sample.vbs, and then click Save.
  5. 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:

  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\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

  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:

  1. Retrace the steps in this article to make sure that
    1. The sample script's syntax is correct.
    2. The sample script was copied to the correct Group Policy folder.
    3. The sample script was added as a logon script (for example, it was not added as a logoff script, startup script, or shutdown script).
  2. Make sure that you log off the client workstation and log back on to refresh the Group Policy settings.
  3. 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)

REFERENCES

For 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


Keywords: kbhowto kbhowtomaster KB324787