You are here: Advanced Concepts > Creating DynaCenter Software Components > Sample Windows Components > Creating a component to Install and Activate a Windows License using Multiple Activation Key (MAK)

Creating a component to Install and Activate a Windows License using Multiple Activation Key (MAK)

This component installs a MAK product license key and attempts to activate the license after the migration completes successfully.

Use Case

You need to automatically activate Windows Server images after they are migrated successfully.

Create the Component

Tip: Sample Script to Create the Windows Multiple Activation Key (MAK) License Component provides a sample script that shows how to automate the manual process outlined in this topic.

Procedure

As a root user on the MWS, complete the following procedure:

  1. Create a component working directory.

    Example: mkdir /root/components

  2. In the components directory, create the directory structure for this component.

    Example: mkdir -p windows-MAK-activation/root

  3. In the components directory, type the following command to change the access permissions of the windows-MAK-activation directory:
    chmod 700 windows-MAK-activation/root
  4. In the windows-MAK-activation directory, create a shell-compatible postprovision script to install and activate the product license.
  5. In the windows-MAK-activation directory, type the following command to change the access permissions of the script:
    chmod 0500 postprovision
  6. In the windows-MAK-activation directory, create a shell-compatible script to set the MAK license key.
  7. In the components directory, type the following command to create the component archive:
    msa --name='configure-windows-MAK-activation' \
    --desc='install product license key' \
    --ostype='Microsoft_Windows-*_*_*-*' \
    windows-MAK-activation
    

    Where:

    Options--nameComponent name; if not specified, the pathname is used
    --descHelpful description for the component
    --ostype

    Operating system of the component and the image it will be applied to

    Note: Each component must have the same os-type as the image that will use it or the deploy will not complete successfully. The dccmd list ostypes command lists valid operating system types. The format supports wildcards; however, it is always best to select the most specific value possible.

    Argument--pathnameComponent directory where the component control files should be placed
  8. In the components directory, type the following command to convert the archive into a component:

    rinstallsnapshot \
    --description='install product license key' \
    --ostype='Microsoft_Windows-*_*_*-* ' \
    configure-windows-MAK-activation \
    configure-windows-MAK-activation.tar \
    default
    

    Where:

    Options --description Helpful description for the component
    --os-type

    Operating system of the component and the image it will be applied to

    Note: Each component must have the same os-type as the image that will use it or the deploy will not complete successfully.

    Arguments name Descriptive name for the software component
    source Component archive used for the component
    repository

    Repository that will hold the component

    Note: This should always be default.

  9. Add the component statement to the deploy profile that will be used with the image deploy task.

    Example:  

    #Deploy configure-windows-MAK-activation component to install product key and activate Windows
    component configure-windows-MAK-activation
    

 

© Copyright Racemi Incorporated 2017. All rights reserved.