#Set variables to be used in logging events
$whoami = whoami
$StartTime = Get-Date
#Log an event that our script is starting
$api.LogScriptEvent("ATAGatewayDiscovery.ps1",3280,0,"v1.8-ATA Gateway Discovery Script is starting. Running as $whoami.")
#Process the data
#$IsEnabled = $jsondata.IsEnabled
#We use this to match to serviceIP of the center
$ServiceProxyServicePrimaryDnsEndpointAddress = $jsondata.CenterWebClientConfigurationServiceEndpoints.Item(0).Address
#port everything 443
$ServiceProxyServicePrimaryDnsEndpointPort = $jsondata.CenterWebClientConfigurationServiceEndpoints.Port #not needed
$ServiceProxyServicePrimaryCertificateThumbprint = $jsondata.CenterWebClientConfigurationServiceCertificateThumbprints.Item(0)
# no seperate thumbprint now
$ManagementClientServerCertificateThumbprint = $jsondata.CenterWebClientConfigurationServiceCertificateThumbprints.Item(0) #not needed
# used to be console address, no longer needed
$ManagementClientServerName = $jsondata.CenterWebClientConfigurationServiceEndpoints.Item(0).Address #not needed
$SystemProfileId = $jsondata.ServiceSystemProfileConfigurationId
$SecretManagerCertificateThumbprint = $jsondata.SecretManagerConfigurationCertificateThumbprint
$Version = (Get-ItemProperty $EXEPath).VersionInfo.ProductVersion
#Log an event for script ending and total execution time.
$EndTime = Get-Date
$ScriptTime = ($EndTime - $StartTime).TotalSeconds
$api.LogScriptEvent("ATAGatewayDiscovery.ps1",3281,0,"v1.8-ATA Gateway Discovery Script is complete. Version is $Version. Total runtime ($ScriptTime) seconds.")
#Output the PropertyBag data for SCOM consumption:
$DiscoveryData
}
Else{
$EndTime = Get-Date
$ScriptTime = ($EndTime - $StartTime).TotalSeconds
$api.LogScriptEvent("ATAGatewayDiscovery.ps1",3281,0,"v1.8-ATA Gateway Discovery Script is complete. This server is not a 1.8 gateway. Total runtime ($ScriptTime) seconds.")
}
}
Else{
#Log an event for script ending and total execution time.
$EndTime = Get-Date
$ScriptTime = ($EndTime - $StartTime).TotalSeconds
$api.LogScriptEvent("ATAGatewayDiscovery.ps1",3281,0,"v1.8-ATA Gateway Discovery Script is complete. This server is not a gateway. Total runtime ($ScriptTime) seconds.")
} </Script></ScriptBody>
<Parameters>
<Parameter>
<Name>sourceID</Name>
<Value>$MPElement$</Value>
</Parameter>
<Parameter>
<Name>managedEntityID</Name>
<Value>$Target/Id$</Value>
</Parameter>
<Parameter>
<Name>computerName</Name>
<Value>$Config/computerName$</Value>
</Parameter>
</Parameters>
<TimeoutSeconds>60</TimeoutSeconds>
</ProbeAction>
</MemberModules>
<Composition>
<Node ID="PowerShell">
<Node ID="Scheduler"/>
</Node>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.Discovery.Data</OutputType>
</DataSourceModuleType>