DataONTAP.Cluster.ManagementServer.ManageResourcePoolMember.WriteActionModuleType (WriteActionModuleType)

Element properties:

TypeWriteActionModuleType
IsolationAny
AccessibilityInternal
RunAsDataONTAP.SecureReference.RunAsProfileMaintenanace
InputTypeSystem.BaseData

Member Modules:

ID Module Type TypeId RunAs 
RunConfigureManagementServerPowershellScript WriteAction Microsoft.Windows.PowerShellWriteAction Default

Overrideable Parameters:

IDParameterTypeSelector
TimeoutSecondsint$Config/TimeoutSeconds$
ManagementServerNamestring$Config/ManagementServerName$
EncryptedInstallationInfostring$Config/EncryptedInstallationInfo$

Source Code:

<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.
##############################################################################

param($managementServerName, $encryptedInstallationInfo)

import-module operationsmanager

$api = new-object -comObject 'MOM.ScriptAPI'

# 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

# Call remote install method
$managementServer.PerformRemoteInstall($managementServerName, $encryptedInstallationInfo)

$successMessage = "OCPM was successfully installed on management server {0}."
$api.LogScriptEvent("ConfigureManagementServer.ps1", 5001, 0, $successMessage -f $managementServerName)
$successMessage -f $managementServerName
}
catch
{
$api.LogScriptEvent("ConfigureManagementServer.ps1", 5002, 1, "Remote install OCPM failed. " + $Error)
throw $Error
}</Script></ScriptBody>
<Parameters>
<Parameter>
<Name>managementServerName</Name>
<Value>$Config/ManagementServerName$</Value>
</Parameter>
<Parameter>
<Name>encryptedInstallationInfo</Name>
<Value>$Config/EncryptedInstallationInfo$</Value>
</Parameter>
</Parameters>
<TimeoutSeconds>$Config/TimeoutSeconds$</TimeoutSeconds>
<StrictErrorHandling>true</StrictErrorHandling>
</WriteAction>
</MemberModules>
<Composition>
<Node ID="RunConfigureManagementServerPowershellScript"/>
</Composition>
</Composite>
</ModuleImplementation>
<InputType>System!System.BaseData</InputType>
</WriteActionModuleType>