<ProbeActionModuleType ID="O365SMP.O365Portal_Login.Performance.Collection.Rule.ProbeActionModuleType" Accessibility="Internal" Batching="false" PassThrough="false">
<Configuration>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="TimeoutSeconds" type="xsd:integer"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="UserCredential" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="UserPassword" type="xsd:string"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="TimeoutSeconds" Selector="$Config/TimeoutSeconds$" ParameterType="int"/>
<OverrideableParameter ID="UserCredential" Selector="$Config/UserCredential$" ParameterType="string"/>
<OverrideableParameter ID="UserPassword" Selector="$Config/UserPassword$" ParameterType="string"/>
</OverrideableParameters>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<ProbeAction ID="Probe" TypeID="Windows!Microsoft.Windows.PowerShellPropertyBagTriggerOnlyProbe">
<ScriptName>CollectMSOLsvc_v1.ps1</ScriptName>
<ScriptBody><Script>
###############################################
#Created by: Ismaen Aboubakare and Brian Zoucha
# Filename: CollectMSOLSvc_v1_5.ps1
# Description: This script tracks the time in ms to connect to the MSOL Service (Office 365)
# Updates: TB-11/7/18 Added success event entry
################################################
#Code for when importing to SCOM to enable user parameters
Param(
[parameter(Mandatory=$true)]
$UserCredential,
[parameter(Mandatory=$true)]
$UserPassword
)
#Getting user Credential and measuring time to connect in Milliseconds. If errors out or user has wrong credentials
#then it will catch and output, unable to connect to MSOL
try{
$msol = Measure-Command{
$Service = Connect-MsolService -Credential $Credential
}
$timeToConnectToMSOL = $msol.Milliseconds
#Write-Host "Time to connect to MSOService $timeToConnectToMSOL ms" -ForegroundColor Cyan
$bag.AddValue(“RTTinMS”,[Double]$msol.Milliseconds)
$api.LogScriptEvent('HealthService',50,0,"O365 Connection Success: Connection established" )
}
catch{
$connectMSOLError = "Unable to connect to MSOL"
#Write-Host $connectionMSOLError -ForegroundColor Red
$api.LogScriptEvent('HealthService',50,1,"O365 Connection ERROR: $connectMSOLError" )
}