Install ADS Web

Cc526841.chm_head_left(en-us,TechNet.10).gif Cc526841.chm_head_middle(en-us,TechNet.10).gif Cc526841.chm_head_right(en-us,TechNet.10).gif

Install ADS Web

This section describes how to install and configure ADS Web, the Web-based user interface for performing Automated Deployment Services (ADS) administrative tasks.

Important

The sample code provided for ADS Web is covered under the terms of the end-user license agreement (EULA) displayed during setup.

The following topics are covered:

  • Install ADS Web
  • ADS Web Advanced Features
  • Working with Sample Code Using Visual Studio
  • Customizing ADS Web
  • Application Architecture Overview
  • Known Issues

Install ADS Web

Note the following prerequisites before you begin installing ADS Web:

  • You must install the ADS Web sample code on an ADS controller running Microsoft Windows Server 2003 R2, Enterprise Edition.
  • You must have ASP.NET and Internet Information Services (IIS) components installed, and network COM+ access enabled on the Controller.
  • You should be comfortable using and administering ADS 1.1.

Procedure SPP.25: To install the ADS Web-based interface

  1. Use Windows Explorer to navigate to the SolutionMedia\Server Purposing\ADSWebUI directory and run the installation file ADSWebSetup.msi.

  2. Accept the EULA and all default settings.

  3. Ensure that Anonymous Access is disabled for the ADS Web site. To disable anonymous access:

    1. Under All Programs, select Administrative Tools, and then click Internet Information Services Manager.
    2. In the IIS console, select Web Sites, select Default Web, and then click ADS Web. Right-click ADS Web, and then click Properties.
    3. In the AdsWeb Properties dialog box, select the Directory Security tab. In the Authentication and access control area, click Edit.
    4. In the Authentication Methods dialog box, clear the Enable anonymous access check box, ensure that the Integrated Windows authentication check box is selected, and then click OK.
    5. Enter the URL https://localhost/adsweb to browse the ADS Web site.

    Installation Notes

    • The first time you request an ADS Web page, it may take time to load. However, after this initial page load, you should not experience an excessive delay again.

    • No estimated end times are available when you first run jobs. Several jobs must be run and completed before time estimates can be generated.

    • Two features of the ADS Web use client-side scripting and Microsoft ActiveX controls to perform their operations. These features are:

      • Mounting and unmounting images using the Web site.
      • All external commands from the Device> All Tasks menu.

      These features will fail on a default installation of Internet Explorer 5 if the security setting Initialize and script ActiveX controls not marked as safe is disabled. To change the browser setting and be able to use these features:

      1. Connect to the ADS Web site. (This ensures that you are in the correct security zone as the setting must be changed per security zone.)
      2. Select Tools, select Internet Options, select the Security tab, and then click Custom Level.
      3. Select the Prompt button under Initialize and script Active X controls not marked as safe.
    • The default DeviceCommands.xml file contains references to external programs that may be installed on your system. See the All Tasks Menu for Devices for more information.

ADS Web Advanced Features

ADS Web offers administrators several advanced features that can make their work easier. Administrators will find that ADS Web differs from the ADS Microsoft Management Console (MMC) snap-in by showing the ADS Controller as a visible device. This feature allows jobs and device variables to be defined for the Controller.

To Disable Showing the ADS Controller as a Device

You can disable showing the ADS Controller as a device.

Procedure SPP.26: To disable showing the ADS Controller as a device

  1. Navigate to the location of the Web site (for example, C:\inetpub\wwwroot\adsweb).
  2. Open the Web.config file using Notepad and find the section similar to the following: <pre IsFakePre="true" xmlns="https://www.w3.org/1999/xhtml">&lt;appSettings&gt; &lt;!-- ShowController - if TRUE then the controller will be shown as a device --&gt; &lt;add key="ShowController" value="true" /&gt; &lt;/appSettings&gt;</pre>
  3. Change the value="true" to value="false".
  4. Restart the Web site.

All Tasks Menu for Devices

Devices are right-click enabled throughout the ADS Web site. One of the menu items on this menu is the All Tasks menu. The menu is dynamically generated by reading an the DeviceCommands.xml located in the root the Web site. The following is an example of the file

`

<?xml version="1.0" encoding="iso-8859-1" ?>
<deviceCommands>

    &lt;command name="Open Remote Desktop" 
 command="MSTSC.EXE /v:$Device.System.Name$"&gt;
    &lt;/command&gt; 
    &lt;command name="Open Remote Desktop by IP" 
 command="MSTSC.EXE /v:$Device.System.adminip$"&gt;
   &lt;/command&gt; 
    &lt;command name="Open Computer Mgmt" 
command="MMC.exe c:\\windows\\system32\\compmgmt.msc

/computer=$Device.System.adminip$"> </command> <command name="-"></command> <command name="Reboot Server" jobTemplate="reboot"></command> <command name="Boot to DA" jobTemplate="boot-to-da"></command> <command name="Boot to HD" jobTemplate="boot-to-hd"></command> <command name="-"></command> <command name="CPQ Console Access" command="explorer.exe https://$device.user.cpqribID$"> </command> <command name="CPQ Power Off" command="cmd /k c:\cpq\CPQLOCfg.exe -s $device.user.cpqribID$ -f c:\cpq\PowerOff.xml -v"> </command>

    &lt;command name="CPQ Power On" 
 command="cmd /k c:\\cpq\\CPQLOCfg.exe -s 

$device.user.cpqribID$ -ยด c:\cpq\PowerOn.xml -v"> </command>

    &lt;command name="-"&gt;&lt;/command&gt; 

    &lt;command name="Debug Sample" 
 command="cmd /k echo Name:$Device.System.Name$
                        IP:$device.system.adminip$ 
Mac:$device.system.adminmac$ &amp;amp; pause"&gt;

</command> </deviceCommands>

`

Note that each command entry has a name and then optional command parameters depending on the type of command required. For example, if the name of the command is "-," then a non-selectable horizontal line is added to the menu. Each command name must be unique. Duplicate command names will result in the wrong command being executed. Commands to call external programs and job tmeplates are shown below:

  • External Programs-Any external command line program can be called by adding a command attribute. Here is an example.<pre IsFakePre="true" xmlns="https://www.w3.org/1999/xhtml">&lt;command name="Open Remote Desktop" command="MSTSC.EXE /v:$Device.System.Name$"&gt; &lt;/command&gt;</pre>

    This command will run the program terminal server and pass the name of the current device

    Device replacement variables follow the ADS replacement format where $<Variable>$ is used. The following table shows the recognized values.

    Tools Description
    Device.System.Name The name of the current device.
    Device.System.Name The name of the current device Device.System.AdminIP The admin IP address of the current device.
    Device.System.AdminMAC The admin MAC address of the current device.
    Device.User.<Variable> The value of any valid variable can be specified for <Variable>. This can be used to return any custom value required.
  • Job Templates -An existing job template can be executed by adding the jobTemplate attribute. The jobTemplate must match the name of an existing job template. For example: <pre IsFakePre="true" xmlns="https://www.w3.org/1999/xhtml">&lt;command name="Reboot Server" jobTemplate="reboot"&gt; &lt;/command&gt;</pre>

Working with Sample Code Using Visual Studio

Modifying ADS sample code to meet your purposes requires installing AdsDevWebSetup.msi. The process is similar to installing the ADSWebSetup.msi.

Note

You can install both setup files on the same computer or on different computers. However, if you install both setup files on a single computer, do not then uninstall one or the other because they will share common components.

Prerequisites

  • You must install the ADS Web sample code on an ADS controller running Windows Server 2003 Enterprise Edition.
  • You must have ASP.NET and IIS components installed and network COM+ access enabled on the server.
  • Microsoft Visual Studio 2003 is recommended for loading the ASP.NET solution and rebuilding the solution.
  • You should be comfortable using and administering ADS 1.1.
  • You should be familiar with ASP.NET, C# and .NET

Installation

In this procedure you install the ADS Web Development (AdsWebDev) application so that you can modify ADS sample code.

Procedure SPP.27: To install the ADS Web Development application

  1. On the Controller, run the installation file AdsDevWebSetup.msi.
  2. Accept the EULA and all default settings.
  3. Ensure that Anonymous Access is disabled for the ADS Web site.To disable anonymous access:
    1. Under All Programs, select Administrative Tools, and then click Internet Information Services Manager.
    2. In the IIS console, select Web Sites, select Default Web, and then click ADS Web. Right-click ADS Web, and then click Properties.
    3. In the AdsWeb Properties dialog box, select the Directory Security tab. In the Authentication and access control area, click Edit.
    4. In the Authentication Methods dialog box, clear the Enable anonymous access check box, ensure that the Integrated Windows authentication check box is selected, and then click OK.
    5. Enter the URL https://localhost/adsdevweb to browse the ADS Web site.

The source files for ADS Web are installed in C:\Program Files\Ads Web Development. A Visual Studio 2003 .sln file is located in the root of this folder. If Visual Studio 2003 is installed, double-clicking on this file will open the solution within Visual Studio 2003. All code needs to be compiled before the ADS Web site reflects code modifications.

Customizing ADS Web

This section provides examples of how ADS Web can be customized.

Changing colors and images -The simplest form of customization does not require the Web site to be rebuilt and can be performed directly on the files in wwwroot/adsweb. Most colors and visual elements can be changed by updating the Style/adsweb.css file and changing images in the images directory.

The form header is controlled by the style sheet and displays the default logo (logo.gif) in a portion of the style sheet as shown below.

`

.headerbackground
{
BACKGROUND-COLOR:#9c9cd8;
}

.headerlogo { background-position: left center; background-image: url(../images/logo.gif); background-repeat: no-repeat; width:32px; height:32px; }

.pageheader { width:100%; font-size:16pt; color:white; }

.pageheaderdescription { font-size:8pt; color:White; }

`

You can change the logo image by modifying this file. For example, using a new logo called my_logo.jpg, you could change the color and logo by modifying the .css file as follows: `

.headerbackground
{
BACKGROUND-COLOR:#0000dd;
}

.headerlogo { background-position: left center; background-image: url(../images/my_logo.jpg); background-repeat: no-repeat; width:32px; height:32px; }

.pageheader { width:100%; font-size:16pt; font-family: Comic Sans MS; color:black; }

.pageheaderdescription { font-size:8pt; color:Black; }

`

Changing main menu item-The main menu items on the left-hand side of the screen are generated by the controls\menu.ascx control. This menu.ascx page uses library functions in the MenuUtils class to generate menu items. The menu is generated in the GetMenu function. Functions to generate a new title row and generate a normal row are described below.

  • GetTitleRow -This function generates a new title row with the title and help URL.<pre IsFakePre="true" xmlns="https://www.w3.org/1999/xhtml">MenuUtils.GetTitleRow(string item, string helpurl)</pre>

    For example:

    <pre IsFakePre="true" xmlns="https://www.w3.org/1999/xhtml">MenuUtils.GetTitleRow("Devices", "help.aspx").</pre>

  • GetMenuRow- This function generates a normal menu row.`

    GetMenuRow(string item, string link, string target)

` For example: `
GetMenuRow("Show", "DeviceList.aspx", "main_frame")
`Clicking on this item would result in the DeviceList.aspx page being shown in the "main\_frame" of the application.

The following procedures will show how to add a new menu item and make a menu item only visislbe to users in a specific group.

Add a New Menu Item

In this procedure assume that there is an ADS set called Production.

Procedure SPP.28: To add a menu item to to show all devices in a new window

  1. Open Controls/menu.ascx.cs within Visual Studio 2003.
  2. Find the GetMenu function and add the following line. An appropriate place to add the line is after the set title.<pre IsFakePre="true" xmlns="https://www.w3.org/1999/xhtml">Reponse.Write( MenuUtils.GetMenuRow( "Show Production", "SetDeviceList.aspx?set=Production", "blank" ) );</pre> Because the target is blank, the browser will open the Setdevicelist.aspx page in a new window. Also, the SetDeviceList.aspx page takes a set name as an argument and, therefore, the set specified devices for the set will be shown.

Hide a Menu Item From Users in a Specific Group

For users logged into an ASP.NET application configured for Integrated Windows authentication, you can hide the menu items relating the tasks you don't wish the user to perform. For example, you may want to ensure that only a device administrators can view and make changes to devices. You do this by selecting groups that the user belongs to and then allow or disallow certain operations for that group.

Procedure SPP.29: To ensure that only device administrators are able to view and change device

  1. Create a new group called Device Admins and add the appropriate users to it.
  2. Open Controls/menu.ascx.cs from within Visual Studio.
  3. Find the part of GetMenu that creates the devices menu. Wrap it in the following if statement.<pre IsFakePre="true" xmlns="https://www.w3.org/1999/xhtml">if(HttpContext.Current.User.IsInRole("DOMAIN\\Device Admins")) { Response.Write(MenuUtils.GetSpacer()); Response.Write(MenuUtils.GetTitleRow("Devices", . . . }</pre>

Note

Note that the devices menu should now only be shown if the current user is a member of the specified group. The \ in the group must be escaped within C#. Valid IsInRole names include:

  • DOMAIN\Group Name
  • MACHINE\Group Name
  • BUILTIN\Group Name

Application Architecture Overview

There are four projects that make up the ADS Web solution:

  • ADSWeb-The ASP.NET Web site is where most customization will occur. It is described in the Customizing ADS Web section.
  • AdsLibrary-This library of functions is used to interact with the ADS controller via the built-in .NET class System.Management and through Windows Management Instrumentation (WMI). The library provides an easy type-safe wrapper around the basic WMI calls provided by ADS.
  • Win32Security-This library is used to interact with Win32 Security Descriptors. It provides a simple method editing and updating security information stored in internal formats.
  • ADSWebSetup-Not part of the Development Configuration. It is normally only built on demand. (It can be build by right-clicking on the project and selecting Build.). This project builds a new .msi file you can use to deploy custom versions of ADS Web.

Directory Structure of the ADS Web Site

The following shows the directory structure and interaction between the projects:

  • ADSWeb Root - All main Web pages
    • bin - All complied binary files.
    • controls - All common controls used by the system.
    • images - All images used by the system.
      • history - Images used for the state of history items.
      • jobstate - Images used to denote each state of a job.
    • js - All client-side script.
    • style - All style sheets for the Web site.
    • library - Source for library functions used by the Web site.

Known Issues

Using set names with special characters- Set names created in the ADS MMC can contain any character. This causes issues when the set names are used in JavaScript and as part of URL. Set names should be limited to the same set of characters as device names: [A-Z][a-z][0-9]_-[space].

Uninstall problems occur when both runtime and development applications are installed-When both runtime (ADSWeb) and development (ADSWebDev) applications are installed on the same computer, uninstalling one of the applications will remove common components. You will need to reinstall the remaining application.