使用 System Center Configuration Manager 自动执行移动服务安装Automate Mobility Service installation with System Center Configuration Manager

使用 Azure Site Recovery 将移动服务安装在要复制到 Azure 的 VMware VM 和物理服务器上The Mobility service is installed on VMware VMs and physical servers that you want to replicate to Azure using Azure Site Recovery

本文提供如何使用 System Center Configuration Manager 在 VMware VM 上部署 Azure Site Recovery 移动服务的示例。This article provides you an example of how you can use System Center Configuration Manager to deploy the Azure Site Recovery Mobility Service on a VMware VM. 使用 Configuration Manager 等软件部署工具具有以下优势:Using a software deployment tool like Configuration Manager has the following advantages:

  • 计划全新安装和升级,在计划内维护时段内进行软件更新Schedule fresh installations and upgrades during your planned maintenance window for software updates
  • 将部署规模扩大为同时部署数百台服务器Scale deployment to hundreds of servers simultaneously

本文使用 System Center Configuration Manager 2012 R2 来演示部署活动。This article uses System Center Configuration Manager 2012 R2 to demonstrate the deployment activity. 我们假定你使用版本 9.9.4510.1 或更高版本的移动服务。We assumes you are using version 9.9.4510.1 or higher of the Mobility service.

或者,可以使用 Azure Automation DSC 自动执行出行服务安装。Alternately, you can automate Mobility Service installation with Azure Automation DSC.

先决条件Prerequisites

  1. 已在环境中部署的软件部署工具,例如 Configuration Manager。A software deployment tool, like Configuration Manager, that's already deployed in your environment.
  2. 应创建两个设备集合,一个用于要使用 Site Recovery 保护的所有 Windows 服务器,另一个用于要保护的所有 Linux 服务器You should create two device collections, one for all Windows servers, and another for all Linux servers, that you want to protect by using Site Recovery.
  3. 已在恢复服务保管库中注册的配置服务器。A configuration server that is already registered in the Recovery Services vault.
  4. 可通过 Configuration Manager 计算机访问的安全网络文件共享(SMB 共享)。A secure network file share (SMB share) that can be accessed by the configuration manager machine.

在 Windows 计算机上部署Deploy on Windows machines

Note

本文假设配置服务器的 IP 地址为 192.168.3.121,且安全网络文件共享为 \\ContosoSecureFS\MobilityServiceInstallers。This article assumes that the IP address of the configuration server is 192.168.3.121, and that the secure network file share is \\ContosoSecureFS\MobilityServiceInstallers.

准备部署Prepare for deployment

  1. 在网络共享上创建一个文件夹,并将其命名为“MobSvcWindows” 。Create a folder on the network share, and name it MobSvcWindows.

  2. 登录配置服务器,并打开管理命令提示符。Sign in to your configuration server, and open an administrative command prompt.

  3. 运行以下命令,生成密码文件:Run the following commands to generate a passphrase file:

    cd %ProgramData%\ASR\home\svsystems\bin

    genpassphrase.exe -v > MobSvc.passphrase

  4. 将“MobSvc.passphrase” 文件复制到网络共享上的“MobSvcWindows” 文件夹。Copy the MobSvc.passphrase file into the MobSvcWindows folder on your network share.

  5. 运行以下命令,浏览到配置服务器上的安装程序存储库:Browse to the installer repository on the configuration server by running the following command:

    cd %ProgramData%\ASR\home\svsystems\pushinstallsvc\repository

  6. Microsoft-ASR_UA_version_Windows_GA_date_Release.exe 复制到网络共享上的 MobSvcWindows 文件夹。Copy the Microsoft-ASR_UA_version_Windows_GA_date_Release.exe to the MobSvcWindows folder on your network share.

  7. 复制以下代码,并将它作为“install.bat” 保存到“MobSvcWindows” 文件夹。Copy the following code, and save it as install.bat into the MobSvcWindows folder.

    Note

    将此脚本中的 [CSIP] 占位符替换为配置服务器的实际 IP 地址值。Replace the [CSIP] placeholders in this script with the actual values of the IP address of your configuration server.

    Time /t >> C:\Temp\logfile.log
    REM ==================================================
    REM ==== Clean up the folders ========================
    RMDIR /S /q %temp%\MobSvc
    MKDIR %Temp%\MobSvc
    MKDIR C:\Temp
    REM ==================================================
    
    REM ==== Copy new files ==============================
    COPY M*.* %Temp%\MobSvc
    CD %Temp%\MobSvc
    REN Micro*.exe MobSvcInstaller.exe
    REM ==================================================
    
    REM ==== Extract the installer =======================
    MobSvcInstaller.exe /q /x:%Temp%\MobSvc\Extracted
    REM ==== Wait 10s for extraction to complete =========
    TIMEOUT /t 10
    REM =================================================
    
    REM ==== Perform installation =======================
    REM =================================================
    
    CD %Temp%\MobSvc\Extracted
    whoami >> C:\Temp\logfile.log
    SET PRODKEY=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
    REG QUERY %PRODKEY%\{275197FC-14FD-4560-A5EB-38217F80CBD1}
    IF NOT %ERRORLEVEL% EQU 0 (
        echo "Product is not installed. Goto INSTALL." >> C:\Temp\logfile.log
        GOTO :INSTALL
    ) ELSE (
        echo "Product is installed." >> C:\Temp\logfile.log
    
        echo "Checking for Post-install action status." >> C:\Temp\logfile.log
        GOTO :POSTINSTALLCHECK
    )
    
    :POSTINSTALLCHECK
        REG QUERY "HKLM\SOFTWARE\Wow6432Node\InMage Systems\Installed Products\5" /v "PostInstallActions" | Find "Succeeded"
        If %ERRORLEVEL% EQU 0 (
            echo "Post-install actions succeeded. Checking for Configuration status." >> C:\Temp\logfile.log
            GOTO :CONFIGURATIONCHECK
        ) ELSE (
            echo "Post-install actions didn't succeed. Goto INSTALL." >> C:\Temp\logfile.log
            GOTO :INSTALL
        )
    
    :CONFIGURATIONCHECK
        REG QUERY "HKLM\SOFTWARE\Wow6432Node\InMage Systems\Installed Products\5" /v "AgentConfigurationStatus" | Find "Succeeded"
        If %ERRORLEVEL% EQU 0 (
            echo "Configuration has succeeded. Goto UPGRADE." >> C:\Temp\logfile.log
            GOTO :UPGRADE
        ) ELSE (
            echo "Configuration didn't succeed. Goto CONFIGURE." >> C:\Temp\logfile.log
            GOTO :CONFIGURE
        )
    
    :INSTALL
        echo "Perform installation." >> C:\Temp\logfile.log
        UnifiedAgent.exe /Role MS /InstallLocation "C:\Program Files (x86)\Microsoft Azure Site Recovery" /Platform "VmWare" /Silent
        IF %ERRORLEVEL% EQU 0 (
            echo "Installation has succeeded." >> C:\Temp\logfile.log
            (GOTO :CONFIGURE)
        ) ELSE (
            echo "Installation has failed." >> C:\Temp\logfile.log
            GOTO :ENDSCRIPT
        )
    
    :CONFIGURE
        echo "Perform configuration." >> C:\Temp\logfile.log
        cd "C:\Program Files (x86)\Microsoft Azure Site Recovery\agent"
        UnifiedAgentConfigurator.exe  /CSEndPoint "[CSIP]" /PassphraseFilePath %Temp%\MobSvc\MobSvc.passphrase
        IF %ERRORLEVEL% EQU 0 (
            echo "Configuration has succeeded." >> C:\Temp\logfile.log
        ) ELSE (
            echo "Configuration has failed." >> C:\Temp\logfile.log
        )
        GOTO :ENDSCRIPT
    
    :UPGRADE
        echo "Perform upgrade." >> C:\Temp\logfile.log
        UnifiedAgent.exe /Platform "VmWare" /Silent
        IF %ERRORLEVEL% EQU 0 (
            echo "Upgrade has succeeded." >> C:\Temp\logfile.log
        ) ELSE (
            echo "Upgrade has failed." >> C:\Temp\logfile.log
        )
        GOTO :ENDSCRIPT
    
    :ENDSCRIPT
        echo "End of script." >> C:\Temp\logfile.log
    
    

创建包Create a package

  1. 登录 Configuration Manager 控制台。Sign in to your Configuration Manager console.

  2. 浏览到“软件库” > “应用程序管理” > “包” 。Browse to Software Library > Application Management > Packages.

  3. 右键单击“包” ,然后选择“创建包” 。Right-click Packages, and select Create Package.

  4. 提供“名称”、“说明”、“制造商”、“语言”和“版本”的值。Provide values for the name, description, manufacturer, language, and version.

  5. 选中“此包包含源文件” 复选框。Select the This package contains source files check box.

  6. 单击“浏览” ,然后选择存储安装程序的网络共享 (\\ContosoSecureFS\MobilityServiceInstaller\MobSvcWindows)。Click Browse, and select the network share where the installer is stored (\\ContosoSecureFS\MobilityServiceInstaller\MobSvcWindows).

    创建包和程序向导的屏幕截图

  7. 在“选择要创建的程序类型” 页上,选择“标准程序” ,然后单击“下一步” 。On the Choose the program type that you want to create page, select Standard Program, and click Next.

    创建包和程序向导的屏幕截图

  8. 在“指定此标准程序的相关信息” 页上,提供以下输入,然后单击“下一步” 。On the Specify information about this standard program page, provide the following inputs, and click Next. (其他输入可以使用其默认值。)(The other inputs can use their default values.)

    参数名称Parameter name Value
    NameName 安装 Azure 移动服务 (Windows)Install Azure Mobility Service (Windows)
    命令行Command line install.batinstall.bat
    程序可运行Program can run 用户是否已登录Whether or not a user is logged on

    创建包和程序向导的屏幕截图

  9. 在下一页中,选择目标操作系统。On the next page, select the target operating systems. 移动服务只能安装在 Windows Server 2012 R2、Windows Server 2012 和 Windows Server 2008 R2 上。Mobility Service can be installed only on Windows Server 2012 R2, Windows Server 2012, and Windows Server 2008 R2.

    创建包和程序向导的屏幕截图

  10. 要完成向导,请单击“下一步” 两次。To complete the wizard, click Next twice.

Note

脚本支持移动服务代理的全新安装和已安装代理的更新。The script supports both new installations of Mobility Service agents and updates to agents that are already installed.

部署包Deploy the package

  1. 在 Configuration Manager 控制台中,右键单击包,然后选择“分发内容” 。In the Configuration Manager console, right-click your package, and select Distribute Content. Configuration Manager 控制台的屏幕截图Screenshot of Configuration Manager console

  2. 选择包应复制到的 分发点Select the distribution points on to which the packages should be copied.

  3. 完成该向导。Complete the wizard. 包随后开始复制到指定的分发点。The package then starts replicating to the specified distribution points.

  4. 完成包分发后,右键单击包,然后选择“部署” 。After the package distribution is done, right-click the package, and select Deploy. Configuration Manager 控制台的屏幕截图Screenshot of Configuration Manager console

  5. 选择在先决条件部分中创建的 Windows Server 设备集合作为部署的目标集合。Select the Windows Server device collection you created in the prerequisites section as the target collection for deployment.

    部署软件向导的屏幕截图

  6. 在“指定内容目标” 页上,选择“分发点” 。On the Specify the content destination page, select your Distribution Points.

  7. 在“指定设置以控制此软件的部署方式” 页上,确保目的为“必需” 。On the Specify settings to control how this software is deployed page, ensure that the purpose is Required.

    部署软件向导的屏幕截图

  8. 在“为此部署指定计划” 页中,指定计划。On the Specify the schedule for this deployment page, specify a schedule. 有关详细信息,请参阅计划包For more information, see scheduling packages.

  9. 在“分发点” 页上,根据数据中心的需求配置属性。On the Distribution Points page, configure the properties according to the needs of your datacenter. 然后完成向导。Then complete the wizard.

    Tip

    为了避免不必要的重新启动,请在每月的维护时段或软件更新时段计划包安装。To avoid unnecessary reboots, schedule the package installation during your monthly maintenance window or software updates window.

    可以使用 Configuration Manager 控制台监视部署进度。You can monitor the deployment progress by using the Configuration Manager console. 转到“监视” > “部署” > “[包名称]” 。Go to Monitoring > Deployments > [your package name].

    用于监视部署的 Configuration Manager 选项的屏幕截图

在 Linux 计算机上部署Deploy on Linux machines

Note

本文假设配置服务器的 IP 地址为 192.168.3.121,且安全网络文件共享为 \\ContosoSecureFS\MobilityServiceInstallers。This article assumes that the IP address of the configuration server is 192.168.3.121, and that the secure network file share is \\ContosoSecureFS\MobilityServiceInstallers.

准备部署Prepare for deployment

  1. 在网络共享上创建一个文件夹,并将其命名为“MobSvcLinux” 。Create a folder on the network share, and name it as MobSvcLinux.

  2. 登录配置服务器,并打开管理命令提示符。Sign in to your configuration server, and open an administrative command prompt.

  3. 运行以下命令,生成密码文件:Run the following commands to generate a passphrase file:

    cd %ProgramData%\ASR\home\svsystems\bin

    genpassphrase.exe -v > MobSvc.passphrase

  4. 将“MobSvc.passphrase” 文件复制到网络共享上的“MobSvcLinux” 文件夹。Copy the MobSvc.passphrase file into the MobSvcLinux folder on your network share.

  5. 运行以下命令,浏览到配置服务器上的安装程序存储库:Browse to the installer repository on the configuration server by running the command:

    cd %ProgramData%\ASR\home\svsystems\pushinstallsvc\repository

  6. 将以下文件复制到网络共享上的“MobSvcLinux” 文件夹:Copy the following files to the MobSvcLinux folder on your network share:

    • Microsoft-ASR_UA*RHEL6-64*release.tar.gzMicrosoft-ASR_UA*RHEL6-64*release.tar.gz
    • Microsoft-ASR_UA*RHEL7-64*release.tar.gzMicrosoft-ASR_UA*RHEL7-64*release.tar.gz
    • Microsoft-ASR_UA*SLES11-SP3-64*release.tar.gzMicrosoft-ASR_UA*SLES11-SP3-64*release.tar.gz
    • Microsoft-ASR_UA*SLES11-SP4-64*release.tar.gzMicrosoft-ASR_UA*SLES11-SP4-64*release.tar.gz
    • Microsoft-ASR_UA*OL6-64*release.tar.gzMicrosoft-ASR_UA*OL6-64*release.tar.gz
    • Microsoft-ASR_UA*UBUNTU-14.04-64*release.tar.gzMicrosoft-ASR_UA*UBUNTU-14.04-64*release.tar.gz
  7. 复制以下代码,并将它作为“install_linux.sh” 保存到“MobSvcLinux” 文件夹。Copy the following code, and save it as install_linux.sh into the MobSvcLinux folder.

    Note

    将此脚本中的 [CSIP] 占位符替换为配置服务器的实际 IP 地址值。Replace the [CSIP] placeholders in this script with the actual values of the IP address of your configuration server.

    #!/usr/bin/env bash
    
    rm -rf /tmp/MobSvc
    mkdir -p /tmp/MobSvc
    INSTALL_DIR='/usr/local/ASR'
    VX_VERSION_FILE='/usr/local/.vx_version'
    
    echo "=============================" >> /tmp/MobSvc/sccm.log
    echo `date` >> /tmp/MobSvc/sccm.log
    echo "=============================" >> /tmp/MobSvc/sccm.log
    
    if [ -f /etc/oracle-release ] && [ -f /etc/redhat-release ]; then
        if grep -q 'Oracle Linux Server release 6.*' /etc/oracle-release; then
            if uname -a | grep -q x86_64; then
                OS="OL6-64"
                echo $OS >> /tmp/MobSvc/sccm.log
                cp *OL6*.tar.gz /tmp/MobSvc
            fi
        fi
    elif [ -f /etc/redhat-release ]; then
        if grep -q 'Red Hat Enterprise Linux Server release 6.* (Santiago)' /etc/redhat-release || \
            grep -q 'CentOS Linux release 6.* (Final)' /etc/redhat-release || \
            grep -q 'CentOS release 6.* (Final)' /etc/redhat-release; then
            if uname -a | grep -q x86_64; then
                OS="RHEL6-64"
                echo $OS >> /tmp/MobSvc/sccm.log
                cp *RHEL6*.tar.gz /tmp/MobSvc
            fi
        elif grep -q 'Red Hat Enterprise Linux Server release 7.* (Maipo)' /etc/redhat-release || \
            grep -q 'CentOS Linux release 7.* (Core)' /etc/redhat-release; then
            if uname -a | grep -q x86_64; then
                OS="RHEL7-64"
                echo $OS >> /tmp/MobSvc/sccm.log
                cp *RHEL7*.tar.gz /tmp/MobSvc
                    fi
        fi
    elif [ -f /etc/SuSE-release ] && grep -q 'VERSION = 11' /etc/SuSE-release; then
        if grep -q "SUSE Linux Enterprise Server 11" /etc/SuSE-release && grep -q 'PATCHLEVEL = 3' /etc/SuSE-release; then
            if uname -a | grep -q x86_64; then
                OS="SLES11-SP3-64"
                echo $OS >> /tmp/MobSvc/sccm.log
                cp *SLES11-SP3*.tar.gz /tmp/MobSvc
            fi
        elif grep -q "SUSE Linux Enterprise Server 11" /etc/SuSE-release && grep -q 'PATCHLEVEL = 4' /etc/SuSE-release; then
            if uname -a | grep -q x86_64; then
                OS="SLES11-SP4-64"
                echo $OS >> /tmp/MobSvc/sccm.log
                cp *SLES11-SP4*.tar.gz /tmp/MobSvc
            fi
        fi
    elif [ -f /etc/lsb-release ] ; then
        if grep -q 'DISTRIB_RELEASE=14.04' /etc/lsb-release ; then
           if uname -a | grep -q x86_64; then
               OS="UBUNTU-14.04-64"
               echo $OS >> /tmp/MobSvc/sccm.log
               cp *UBUNTU-14*.tar.gz /tmp/MobSvc
           fi
        fi
    else
        exit 1
    fi
    
    if [ -z "$OS" ]; then
        exit 1
    fi
    
    Install()
    {
        echo "Perform Installation." >> /tmp/MobSvc/sccm.log
        ./install -q -d ${INSTALL_DIR} -r MS -v VmWare
        RET_VAL=$?
        echo "Installation Returncode: $RET_VAL" >> /tmp/MobSvc/sccm.log
        if [ $RET_VAL -eq 0 ]; then
            echo "Installation has succeeded. Proceed to configuration." >> /tmp/MobSvc/sccm.log
            Configure
        else
            echo "Installation has failed." >> /tmp/MobSvc/sccm.log
            exit $RET_VAL
        fi
    }
    
    Configure()
    {
        echo "Perform configuration." >> /tmp/MobSvc/sccm.log
        ${INSTALL_DIR}/Vx/bin/UnifiedAgentConfigurator.sh -i [CSIP] -P MobSvc.passphrase
        RET_VAL=$?
        echo "Configuration Returncode: $RET_VAL" >> /tmp/MobSvc/sccm.log
        if [ $RET_VAL -eq 0 ]; then
            echo "Configuration has succeeded." >> /tmp/MobSvc/sccm.log
        else
            echo "Configuration has failed." >> /tmp/MobSvc/sccm.log
            exit $RET_VAL
        fi
    }
    
    Upgrade()
    {
        echo "Perform Upgrade." >> /tmp/MobSvc/sccm.log
        ./install -q -v VmWare
        RET_VAL=$?
        echo "Upgrade Returncode: $RET_VAL" >> /tmp/MobSvc/sccm.log
        if [ $RET_VAL -eq 0 ]; then
            echo "Upgrade has succeeded." >> /tmp/MobSvc/sccm.log
        else
            echo "Upgrade has failed." >> /tmp/MobSvc/sccm.log
            exit $RET_VAL
        fi
    }
    
    cp MobSvc.passphrase /tmp/MobSvc
    cd /tmp/MobSvc
    
    tar -zxvf *.tar.gz
    
    if [ -e ${VX_VERSION_FILE} ]; then
        echo "${VX_VERSION_FILE} exists. Checking for configuration status." >> /tmp/MobSvc/sccm.log
        agent_configuration=$(grep ^AGENT_CONFIGURATION_STATUS "${VX_VERSION_FILE}" | cut -d"=" -f2 | tr -d " ")
        echo "agent_configuration=$agent_configuration" >> /tmp/MobSvc/sccm.log
         if [ "$agent_configuration" == "Succeeded" ]; then
            echo "Agent is already configured. Proceed to Upgrade." >> /tmp/MobSvc/sccm.log
            Upgrade
        else
            echo "Agent is not configured. Proceed to Configure." >> /tmp/MobSvc/sccm.log
            Configure
        fi
    else
        Install
    fi
    
    cd /tmp
    
    

创建包Create a package

  1. 登录 Configuration Manager 控制台。Sign in to your Configuration Manager console.

  2. 浏览到“软件库” > “应用程序管理” > “包” 。Browse to Software Library > Application Management > Packages.

  3. 右键单击“包” ,然后选择“创建包” 。Right-click Packages, and select Create Package.

  4. 提供“名称”、“说明”、“制造商”、“语言”和“版本”的值。Provide values for the name, description, manufacturer, language, and version.

  5. 选中“此包包含源文件” 复选框。Select the This package contains source files check box.

  6. 单击“浏览” ,然后选择存储安装程序的网络共享(\\ContosoSecureFS\MobilityServiceInstaller\MobSvcLinux)。Click Browse, and select the network share where the installer is stored (\\ContosoSecureFS\MobilityServiceInstaller\MobSvcLinux).

    创建包和程序向导的屏幕截图

  7. 在“选择要创建的程序类型” 页上,选择“标准程序” ,然后单击“下一步” 。On the Choose the program type that you want to create page, select Standard Program, and click Next.

    创建包和程序向导的屏幕截图

  8. 在“指定此标准程序的相关信息” 页上,提供以下输入,然后单击“下一步” 。On the Specify information about this standard program page, provide the following inputs, and click Next. (其他输入可以使用其默认值。)(The other inputs can use their default values.)

    参数名称Parameter name Value
    NameName 安装 Azure 移动服务 (Linux)Install Azure Mobility Service (Linux)
    命令行Command line ./install_linux.sh./install_linux.sh
    程序可运行Program can run 用户是否已登录Whether or not a user is logged on

    创建包和程序向导的屏幕截图

  9. 在下一页中,选择“此程序可以在任何平台上运行” 。On the next page, select This program can run on any platform. 创建包和程序向导的屏幕截图Screenshot of Create Package and Program wizard

  10. 要完成向导,请单击“下一步” 两次。To complete the wizard, click Next twice.

Note

脚本支持移动服务代理的全新安装和已安装代理的更新。The script supports both new installations of Mobility Service agents and updates to agents that are already installed.

部署包Deploy the package

  1. 在 Configuration Manager 控制台中,右键单击包,然后选择“分发内容” 。In the Configuration Manager console, right-click your package, and select Distribute Content. Configuration Manager 控制台的屏幕截图Screenshot of Configuration Manager console

  2. 选择包应复制到的 分发点Select the distribution points on to which the packages should be copied.

  3. 完成该向导。Complete the wizard. 包随后开始复制到指定的分发点。The package then starts replicating to the specified distribution points.

  4. 完成包分发后,右键单击包,然后选择“部署” 。After the package distribution is done, right-click the package, and select Deploy. Configuration Manager 控制台的屏幕截图Screenshot of Configuration Manager console

  5. 选择在先决条件部分中创建的 Linux Server 设备集合作为部署的目标集合。Select the Linux Server device collection you created in the prerequisites section as the target collection for deployment.

    部署软件向导的屏幕截图

  6. 在“指定内容目标” 页上,选择“分发点” 。On the Specify the content destination page, select your Distribution Points.

  7. 在“指定设置以控制此软件的部署方式” 页上,确保目的为“必需” 。On the Specify settings to control how this software is deployed page, ensure that the purpose is Required.

    部署软件向导的屏幕截图

  8. 在“为此部署指定计划” 页中,指定计划。On the Specify the schedule for this deployment page, specify a schedule. 有关详细信息,请参阅计划包For more information, see scheduling packages.

  9. 在“分发点” 页上,根据数据中心的需求配置属性。On the Distribution Points page, configure the properties according to the needs of your datacenter. 然后完成向导。Then complete the wizard.

移动服务将根据配置的计划安装在 Linux 服务器设备集合上。Mobility Service gets installed on the Linux Server Device Collection, according to the schedule you configured.

卸载移动服务Uninstall the Mobility service

可以创建用于卸载移动服务的 Configuration Manager 包。You can create Configuration Manager packages to uninstall Mobility Service. 使用以下脚本执行相关操作:Use the following script to do so:

Time /t >> C:\logfile.log
REM ==================================================
REM ==== Check if Mob Svc is already installed =======
REM ==== If not installed no operation required ========
REM ==== Else run uninstall command =====================
REM ==== {275197FC-14FD-4560-A5EB-38217F80CBD1} is ====
REM ==== guid for Mob Svc Installer ====================
whoami >> C:\logfile.log
NET START | FIND "InMage Scout Application Service"
IF  %ERRORLEVEL% EQU 1 (GOTO :INSTALL) ELSE GOTO :UNINSTALL
:NOOPERATION
                echo "No Operation Required." >> c:\logfile.log
                GOTO :ENDSCRIPT
:UNINSTALL
                echo "Uninstall" >> C:\logfile.log
                MsiExec.exe /qn /x {275197FC-14FD-4560-A5EB-38217F80CBD1} /L+*V "C:\ProgramData\ASRSetupLogs\UnifiedAgentMSIUninstall.log"
:ENDSCRIPT

后续步骤Next steps

现在,可为虚拟机 启用保护You are now ready to enable protection for your virtual machines.