<WriteActionModuleType ID="DataONTAP.Cluster.ManagementServer.ManageResourcePoolMember.WriteActionModuleType" Accessibility="Internal" Batching="false" RunAs="DS!DataONTAP.SecureReference.RunAsProfileMaintenanace">
<Configuration>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="TimeoutSeconds" type="xsd:integer"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="ManagementServerName" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="EncryptedInstallationInfo" type="xsd:string"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="TimeoutSeconds" Selector="$Config/TimeoutSeconds$" ParameterType="int"/>
<OverrideableParameter ID="ManagementServerName" Selector="$Config/ManagementServerName$" ParameterType="string"/>
<OverrideableParameter ID="EncryptedInstallationInfo" Selector="$Config/EncryptedInstallationInfo$" ParameterType="string"/>
</OverrideableParameters>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<WriteAction ID="RunConfigureManagementServerPowershellScript" TypeID="Windows!Microsoft.Windows.PowerShellWriteAction">
<!-- ScriptName specifies the name of the script. -->
<ScriptName>ConfigureManagementServer.ps1</ScriptName>
<!-- ScriptBody is the text of the script. -->
<ScriptBody><Script>##############################################################################
# Copyright (c) 2013 NetApp.
#
# ConfigureManagementServer.ps1
#
# This script calls Management Server c# code to remote install OCPM on
# management server. This script passes along the encrypted information that
# required for installing OCPM on the management server to the c# code that
# actually does the remote install.
##############################################################################
# Construct the event message with management server name
$eventMessage = "Installing OCPM on Management server {0}."
# Log event with number 5000
$api.LogScriptEvent("ConfigureManagementServer.ps1", 5000, 0, $eventMessage -f $managementServerName)
try
{
if (Test-Path -path HKLM:\SOFTWARE\NetApp\OnCommand\MS_Plugin)
{
# Check for the registry key value of the install location for NetApp
$key = get-itemproperty "HKLM:\SOFTWARE\NetApp\OnCommand\MS_Plugin"
}
elseif (Test-Path -path HKLM:\SOFTWARE\IBM\OnCommand\MS_Plugin)
{
# Check for IBM registry key since can't find NetApp
$key= get-itemproperty "HKLM:\SOFTWARE\IBM\OnCommand\MS_Plugin"
}
else
{
$errorMessage = "Error: OnCommand Plug-in for Microsoft is not installed on local machine."
$api.LogScriptEvent("Monitoring.ps1", 5002, 1, $errorMessage)
throw $errorMessage
}
$value = $key.InstallPath
# Load the OC.Cluster.OM.Server assembly from the install location
$assembly = [Reflection.Assembly]::LoadFrom($value + 'OC.Cluster.OM.Management.Tasks.dll')
# Remote install on the server
# Create a new Discovery object
$managementServer = New-Object OC.Cluster.OM.Management.Tasks.RemoteInstall