Microsoft.SystemCenter.ServiceProvider.SSIDRegSyncWriteAction (WriteActionModuleType)

Element properties:

TypeWriteActionModuleType
IsolationAny
AccessibilityInternal
RunAsDefault
InputTypeSystem.BaseData

Member Modules:

ID Module Type TypeId RunAs 
Script WriteAction Microsoft.Windows.ScriptWriteAction Default

Source Code:

<WriteActionModuleType ID="Microsoft.SystemCenter.ServiceProvider.SSIDRegSyncWriteAction" Accessibility="Internal" Batching="false">
<Configuration/>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<WriteAction ID="Script" TypeID="Windows!Microsoft.Windows.ScriptWriteAction">
<ScriptName>SSIDRegSync.vbs</ScriptName>
<Arguments/>
<ScriptBody><Script>

'*************************************************************************
' Script Name - SSIDRegSync.vbs
'
' Purpose - Synchronizes the SSID reg keys between the SCE management group and the gateway management group
' '
' Assumptions - Script is run as a runtime task
'
' Parameters -
'
' (c) Copyright 2006, Microsoft Corporation, All Rights Reserved
' Proprietary and confidential to Microsoft Corporation
'*************************************************************************
OPTION EXPLICIT

CONST HKLM = &amp;H80000002

Dim strManagementGroup, strSCEManagementGroup
Dim WshNetwork, objReg, arrSubKeys, subkey, strValue, strPath, arrBinValue, objShell

Set WshNetwork = WScript.CreateObject("WScript.Network")
Set objShell = Wscript.CreateObject("WScript.Shell")

strSCEManagementGroup = WshNetwork.ComputerName &amp; "_MG"

Set objReg = GetObject("winmgmts:root\default:StdRegProv")

If objReg Is Nothing then

Wscript.Echo "Unabled to bind to StdRegProv"
Wscript.Quit

End If

objReg.EnumKey HKLM, "SOFTWARE\Microsoft\Microsoft Operations Manager\3.0\Server Management Groups", arrSubKeys

If IsNull(arrSubKeys) = true then

'Wscript.echo "System Center Essentials is not installed"
Wscript.quit

End If

If UBound(arrSubKeys) &lt;&gt; 1 then

'Wscript.echo "This server is not in Service Provider Mode"
Wscript.Quit
End If

For each subkey in arrSubKeys

If subkey &lt;&gt; strSCEManagementGroup then

strManagementGroup = subkey
'Wscript.echo "Found Gateway MG " &amp; strManagementGroup
End If

Next

' find default action account
' check to see if its changed
' if changed
' stop health service
' update
' start health service


objReg.EnumKey HKLM, "SYSTEM\CurrentControlSet\Services\HealthService\Parameters\Management Groups\" &amp; strSCEManagementGroup &amp; "\SSDB\References\", arrSubKeys

For each subkey in arrSubKeys

objReg.CreateKey HKLM, "SYSTEM\CurrentControlSet\Services\HealthService\Parameters\Management Groups\" &amp; strManagementGroup &amp; "\SSDB\References\" &amp; subkey
objReg.GetStringValue HKLM, "SYSTEM\CurrentControlSet\Services\HealthService\Parameters\Management Groups\" &amp; strSCEManagementGroup &amp; "\SSDB\References\" &amp; subkey, empty, strValue
objReg.SetStringValue HKLM, "SYSTEM\CurrentControlSet\Services\HealthService\Parameters\Management Groups\" &amp; strManagementGroup &amp; "\SSDB\References\" &amp; subkey, empty, strValue
Next

objReg.EnumKey HKLM, "SYSTEM\CurrentControlSet\Services\HealthService\Parameters\Management Groups\" &amp; strSCEManagementGroup &amp; "\SSDB\SSIDs", arrSubKeys

For each subkey in arrSubKeys

Set arrBinValue = Nothing

objReg.CreateKey HKLM,"SYSTEM\CurrentControlSet\Services\HealthService\Parameters\Management Groups\" &amp; strManagementGroup &amp; "\SSDB\SSIDs\" &amp; subkey
strPath = "SYSTEM\CurrentControlSet\Services\HealthService\Parameters\Management Groups\" &amp; strSCEManagementGroup &amp; "\SSDB\SSIDs\" &amp; subkey

objReg.GetBinaryValue HKLM,strPath,empty,arrBinValue

strPath = "SYSTEM\CurrentControlSet\Services\HealthService\Parameters\Management Groups\" &amp; strManagementGroup &amp; "\SSDB\SSIDs\" &amp; subkey
objReg.SetBinaryValue HKLM,strPath,empty,arrBinValue

objReg.GetDWORDValue HKLM, "SYSTEM\CurrentControlSet\Services\HealthService\Parameters\Management Groups\" &amp; strSCEManagementGroup &amp; "\SSDB\SSIDs\" &amp; subkey, "Type", strValue
objReg.SetDWORDValue HKLM, "SYSTEM\CurrentControlSet\Services\HealthService\Parameters\Management Groups\" &amp; strManagementGroup &amp; "\SSDB\SSIDs\" &amp; subkey, "Type", strValue

Next

objShell.Run "net stop healthservice"
objShell.Run "net start healthservice"

</Script></ScriptBody>
<TimeoutSeconds>120</TimeoutSeconds>
</WriteAction>
</MemberModules>
<Composition>
<Node ID="Script"/>
</Composition>
</Composite>
</ModuleImplementation>
<InputType>System!System.BaseData</InputType>
</WriteActionModuleType>