Detectie-engine scripts

Microsoft.SystemCenter2012.ConfigurationManager.ScriptDiscoveryEngine (ProbeActionModuleType)

Deze module wordt gebruikt voor de detectie van siterollen.

Element properties:

TypeProbeActionModuleType
IsolationAny
AccessibilityPublic
RunAsDefault
InputTypeSystem.BaseData
OutputTypeSystem.Discovery.Data

Member Modules:

ID Module Type TypeId RunAs 
PA ProbeAction Microsoft.Windows.ScriptDiscoveryProbe Default

Overrideable Parameters:

IDParameterTypeSelectorDisplay NameDescription
LogLevelint$Config/LogLevel$Logniveau
TimeoutSecondsint$Config/TimeoutSeconds$Time-out (seconden)

Source Code:

<ProbeActionModuleType ID="Microsoft.SystemCenter2012.ConfigurationManager.ScriptDiscoveryEngine" Accessibility="Public" Batching="false" PassThrough="false">
<Configuration>
<IncludeSchemaTypes>
<SchemaType>System!System.CommandExecuterSchema</SchemaType>
</IncludeSchemaTypes>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="ScriptName" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="LogLevel" type="xsd:integer"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="Arguments" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="ScriptBody" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="0" maxOccurs="1" name="SecureInput">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="256"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<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="0" maxOccurs="1" name="EventPolicy" type="CommandExecuterEventPolicyType"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="LogLevel" Selector="$Config/LogLevel$" ParameterType="int"/>
<OverrideableParameter ID="TimeoutSeconds" Selector="$Config/TimeoutSeconds$" ParameterType="int"/>
</OverrideableParameters>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<ProbeAction ID="PA" TypeID="Windows!Microsoft.Windows.ScriptDiscoveryProbe">
<ScriptName>$Config/ScriptName$</ScriptName>
<Arguments>$Config/Arguments$ $Config/LogLevel$ </Arguments>
<ScriptBody><Script><!-- $IncludeFileContent/"../../../Scripts/MEF.js"$ --><!-- $IncludeFileContent/"../../../Scripts/WMI.js"$ --><!-- $IncludeFileContent/"../../../Scripts/Discovery/Library.js"$ --><!-- $IncludeFileContent/"../../../Scripts/Discovery/RoleClassMap.js"$ --><!-- $IncludeFileContent/"../../../Scripts/Discovery/ComponentNames.js"$ --><!-- $IncludeFileContent/"../../../Scripts/Discovery/EngineBody.js"$ -->$ = (function ($, undefined) {
var EXIT = function (code) {
if (code === undefined) {
$.Quit(0);
}
else {
$.Quit(code);
}
};
var PRINT = function () {
var message = arguments[0];
var length = arguments.length;
var text = !message ? "" : (!(message.toString) ? "ActiveXObject {...}" : message.toString());

if (length == 1) {
$.Echo(text);
}
else {
var i = 1;
for (; i &lt; length; i++) {
if ((object = arguments[i]) != null) {
var append = !object ? "" : (!(object.toString) ? "ActiveXObject {...}" : object.toString());
$.Echo(text + append);
}
else {
$.Echo(text);
}
}
}
};
var ASSERT = function (condition, message, ignore) {
if (condition === false) {
PRINT("!! " + message);
if (!ignore) {
EXIT(-1);
}
}
};

var MEF = (function () {
var toString = Object.prototype.toString;
var exporters = {};
var instances = {};
var class2type = {};

var MEF = function (selector, context, options) {
// The MEF object is actually just the init constructor 'enhanced'
return new MEF.fn.init(selector, context, options);
};
var EXPORT = function (name, ctor) {
exporters[name] = ctor;
instances[name] = undefined;
};
var EXISTS = function (selector) {
if (!selector) {
return false;
}
else if (typeof selector === "string") {
var ctor = exporters[selector];
if (!ctor) {
return false;
}
return true;
}
else {
return false;
}
};
var IMPORT = function (selector, context, options) {
if (!selector) {
return undefined;
}
else if (typeof selector === "string") {
var ctor = exporters[selector];
if (!ctor) {
if (context == false) {
throw selector + " not exported!";
}
else {
return undefined;
}
}
return ctor.call(options);
}
else {
throw selector + " not supported!";
}
};

MEF.fn = MEF.prototype = {
Value: function (newVal) {
if (newVal != undefined) this._Value = newVal;
return this._Value;
},
init: function (selector, options) {
// global, can only query by string
if (selector != undefined &amp;&amp; typeof selector === "string") {
var value = instances[selector];
if (value === undefined) {
value = IMPORT(selector, false, this.extend({
name: "#" + selector,
Value: function () {
return this._Value;
}
}));
if (value != undefined) {
instances[selector] = value;
}
}
return value;
}
else if (selector != undefined) {
return MEF.extend(selector, this);
}
else {
return undefined;
}
},
each: function (callback) {
MEF.ForEach(this.call(this), callback);
},
first: function () {
var retVal;
MEF.ForEach(this.call(this), function () {
retVal = this;
return false
});
return retVal;
},
to_s: function () {
var v = this.Value();
if (v == undefined) {
return "null";
}
else {
return ":" + v.toString();
}
}
}

// Give the init function the MEF prototype for later instantiation
MEF.fn.init.prototype = MEF.fn;

MEF.extend = MEF.fn.extend = function () {
var options, name, src, copy, copyIsArray, clone, target = arguments[0] || {},
i = 1,
length = arguments.length,
deep = false;

// Handle a deep copy situation
if (typeof target === "boolean") {
deep = target;
target = arguments[1] || {};
// skip the boolean and the target
i = 2;
}

// Handle case when target is a string or something (possible in deep copy)
if (typeof target !== "object" &amp;&amp; !MEF.isFunction(target)) {
target = {};
}

// extend MEF itself if only one argument is passed
if (length === i) {
target = this;
--i;
}

for (; i &lt; length; i++) {
// Only deal with non-null/undefined values
if ((options = arguments[i]) != null) {
// Extend the base object
for (name in options) {
src = target[name];
copy = options[name];

// Prevent never-ending loop
if (target === copy) {
continue;
}

// Recurse if we're merging plain objects or arrays
if (deep &amp;&amp; copy &amp;&amp; (MEF.isPlainObject(copy) || (copyIsArray = MEF.isArray(copy)))) {
if (copyIsArray) {
copyIsArray = false;
clone = src &amp;&amp; MEF.isArray(src) ? src : [];

} else {
clone = src &amp;&amp; MEF.isPlainObject(src) ? src : {};
}

// Never move original objects, clone them
target[name] = MEF.extend(deep, clone, copy);

// Don't bring in undefined values
} else if (copy !== undefined) {
target[name] = copy;
}
}
}
}

// Return the modified object
return target;
};

MEF.extend({
version: "1.0.0",
Arguments: $.Arguments,
WriteLine: PRINT,
Assert: ASSERT,
Exists: EXISTS,
Export: EXPORT,
Import: function (selector, options) {
// context, query by string or undefined
var val = new MEF.fn.init(undefined);
return IMPORT(selector, true, val.extend(options));
},

Value: function (selector, value) {
instances[selector]._Value = value;
},
// args is for internal usage only
ForEach: function (object, callback, args) {
var name, i = 0,
length = object.length,
isObj = length === undefined || MEF.isFunction(object),
isCom = isObj &amp;&amp; !object.toString;

if (args) {
if (isObj) {
for (name in object) {
if (callback.apply(object[name], args) === false) {
break;
}
}
} else {
for (; i &lt; length;) {
if (callback.apply(object[i++], args) === false) {
break;
}
}
}

// A special, fast, case for the most common use of each
} else {
if (isCom) {
var e = new Enumerator(object);
for (; !e.atEnd(); e.moveNext()) {
value = e.item();
if (callback.call(value, i++, value) === false) {
break;
}
}
}
else if (isObj) {
for (name in object) {
if (callback.call(object[name], name, object[name]) === false) {
break;
}
}
} else {
for (var value = object[0];
i &lt; length &amp;&amp; callback.call(value, i, value) !== false; value = object[++i]) {}
}
}

return object;
},

Dump: function (object) {
MEF.ForEach(object, function(key, value) {
if (typeof value !== "object" &amp;&amp; !MEF.isFunction(value)) {
PRINT(" ", key);
PRINT("", value);
}
});
},

// string helpers
Trim: function (str, whitespace) {
if (str == null) {
return null;
}
else if (!whitespace) {
return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
}
else {
for (var i = 0; i &lt; str.length; i++) {
if (whitespace.indexOf(str.charAt(i)) === -1) {
str = str.substring(i);
break;
}
}
for (i = str.length - 1; i &gt;= 0; i--) {
if (whitespace.indexOf(str.charAt(i)) === -1) {
str = str.substring(0, i + 1);
break;
}
}
return whitespace.indexOf(str.charAt(0)) === -1 ? str : '';
}
},
EqualsIgnoreCase: function (left, right) {
if (left == null || right == null) {
if (left == null &amp;&amp; right == null) {
return true;
}
else {
return false;
}
}

return left.toUpperCase() == right.toUpperCase();
},
Format: function (frmt, args) {
for (var x = 0; x &lt; arguments.length; x++) {
frmt = frmt.replace("{" + x + "}", arguments[x + 1]);
}

return frmt;
},
IsNullOrEmpty: function (str) {
if (!str)
{
return true;
}

return MEF.Trim(str) === "";
},

// print helpers
_: PRINT,
Return: function (value) {
PRINT("//-----------------------------------------------------------------------");
MEF.ForEach(value.toString().split("\n"), function () {
PRINT("// " + this);
});
PRINT("//-----------------------------------------------------------------------");
},

// type check
type: function (obj) {
return obj == null ? String(obj) : class2type[toString.call(obj)] || "object";
},
isFunction: function (obj) {
return MEF.type(obj) === "function";
},
isArray: Array.isArray ||
function (obj) {
return MEF.type(obj) === "array";
},
isPlainObject: function (obj) {
// Must be an Object.
// Because of IE, we also have to check the presence of the constructor property.
// Make sure that DOM nodes and window objects don't pass through, as well
if (!obj || MEF.type(obj) !== "object" || obj.nodeType || MEF.isWindow(obj)) {
return false;
}

// Not own constructor property must be Object
if (obj.constructor &amp;&amp; !hasOwn.call(obj, "constructor") &amp;&amp; !hasOwn.call(obj.constructor.prototype, "isPrototypeOf")) {
return false;
}

// Own properties are enumerated firstly, so to speed up,
// if last one is own, then all properties are own.

var key;
for (key in obj) {}

return key === undefined || hasOwn.call(obj, key);
}
});

// Populate the class2type map
MEF.ForEach("Boolean Number String Function Array Date RegExp Object".split(" "), function (i, name) {
class2type["[object " + name + "]"] = name.toLowerCase();
});

return MEF;
})();

return MEF;
})(WScript);

(function ($) {
$.Export("0", function () {
this._Value = 0;
return this;
});
})($);
(function ($) {
var HEX = (function (int32) {
return "0x" + UNSIGNED(int32).toString(16).toUpperCase();
});
var UNSIGNED = (function (int32) {
return 0xFFFFFFFF + int32 + 1;
});
var DIAGNOSE = (function (err) {
if (UNSIGNED(err.number) == 0x8004100E) {
$.WriteLine("0x8004100E, Error: Invalid namespace");
}
else {
$.WriteLine("Unknown Error: ", HEX(err.number));
}
});

$.Export("WMI", function () {
// variable "wmi" is requred when creating "WMI.Class" instance
var wmi = $.extend(function (clazz) {
if ($.Exists("." + clazz) == false) {
$.Export("." + clazz, function () {
return $.Import("WMI.Class", {
ClassName: clazz,
WMI: wmi
});
});
}

return $("." + clazz);
}, this, {
WmiServer: undefined,
Connect: function (server, root) {
var conn = "winmgmts:{impersonationLevel=impersonate,authenticationLevel=pktPrivacy}!";
if (!server) {
conn += root;
}
else {
conn += "\\\\" + server + "\\" + root;
}

try {
this.WmiServer = GetObject(conn);
}
catch (error) {
DIAGNOSE(error);
throw error;
}

return this;
},
TryConnect: function (server, root) {
var conn = "winmgmts:{impersonationLevel=impersonate,authenticationLevel=pktPrivacy}!";
if (!server) {
conn += root;
}
else {
conn += "\\\\" + server + "\\" + root;
}

try {
this.WmiServer = GetObject(conn);
}
catch (error) {
return undefined;
}

return this;
},
Query: function (query, callback) {
var values = this.WmiServer.ExecQuery(query);

if (values.Count != 0) {
$.ForEach(values, callback);
return true;
}
else {
return false;
}
}
});

return wmi;
});

$.Export("WMI.Class", function () {
this._Value = [];

return $.extend(function () {
var values = this.WMI.WmiServer.ExecQuery("SELECT * FROM " + this.ClassName);

if (values.Count != 0) {
this._Value = values;
}
else {
this._Value = [];
}

return this._Value;
}, this, {
Where: function (condition) {
return $.Import("WMI.Query", {
WMI: this.WMI,
ClassName: this.ClassName,
Condition: condition,
Sorted: undefined
});
},
OrderBy: function (order) {
return $.Import("WMI.Query", {
WMI: this.WMI,
ClassName: this.ClassName,
Condition: undefined,
Sorted: order
});
},
Execute: function (method, input, output) {
var wmiInput, wmiOutput;
var wmiClass = this.WMI.WmiServer.Get(this.ClassName);
var wmiMethod = wmiClass.Methods_.Item(method);

if (wmiMethod.InParameters != null) {
wmiInput = input.call(wmiMethod.InParameters.SpawnInstance_());
wmiOutput = wmiClass.ExecMethod_(wmiMethod.Name, wmiInput);
}
else {
wmiOutput = wmiClass.ExecMethod_(wmiMethod.Name);
}

if (output != undefined) {
return output.call(wmiOutput);
}
}
});
});

$.Export("WMI.Query", function () {
this._Value = [];

return $.extend(function () {
var order = (!this.Sorted) ? "" : " ORDER BY " + this.Sorted;
var where = (!this.Condition) ? "" : " WHERE " + this.Condition;
var values = this.WMI.WmiServer.ExecQuery("SELECT * FROM " + this.ClassName + order + where);

if (values.Count != 0) {
this._Value = values;
}
else {
this._Value = [];
}

return this._Value;
}, this, {
OrderBy: function (order) {
var newOrder = (!this.Sorted) ? order : this.Sorted + ", " + order;

return $.Import("WMI.Query", {
WMI: this.WMI,
ClassName: this.ClassName,
Condition: this.Condition,
Sorted: newOrder
});
}
});
});
})($);
(function ($, scriptAPI, undefined) {
var numArgs = $.Arguments.Count();

var sourceId = $.Arguments(0);
var managedEntityId = $.Arguments(1);
var siteServer = $.Arguments(2);

$.WriteLine("arguments: ", sourceId, managedEntityId, siteServer);

$.Export("Mom.ScriptAPI", function () {
return scriptAPI != undefined ? scriptAPI : WScript.CreateObject("Mom.ScriptAPI");
});
$.Export("DiscoveryData", function () {
return $("Mom.ScriptAPI").CreateDiscoveryData(0, sourceId, managedEntityId);
});
$.Return = function (value) {
$("Mom.ScriptAPI").Return(value);
};

$.Export("ConfigMgr", function () {
var siteCode = $("CIMv2").GetRegistryStringValue("SOFTWARE\\Microsoft\\SMS\\Identification", "Site Code");
var siteId = $("CIMv2").GetRegistryStringValue("SOFTWARE\\Microsoft\\SMS\\Identification", "Site ID");

var siteWmi = $.Import("WMI").TryConnect(siteServer, "root\\sms");
var sdkProv;
var providerLocation;

if (siteWmi === undefined) {
var parentSiteCode = $("CIMv2").GetRegistryStringValue("SOFTWARE\\Microsoft\\SMS\\Identification", "Parent Site Code");
var parentSiteServer = $("CIMv2").GetRegistryStringValue("SOFTWARE\\Microsoft\\SMS\\Identification", "Parent Server");

if (parentSiteServer.length === 0) {
var sqlServer = $("CIMv2").GetRegistryStringValue("SOFTWARE\\Microsoft\\SMS\\SQL Server", "Server");
var database = $("CIMv2").GetRegistryStringValue("SOFTWARE\\Microsoft\\SMS\\SQL Server", "Database Name");
// If we are using sql named instance
if (database.indexOf("\\") !== -1) {
var databaseArray = database.split("\\");
sqlServer = sqlServer + "\\" + databaseArray[0];
database = databaseArray[1];
}
var sqlConnection = new ActiveXObject("ADODB.Connection");
var connectionString = "Data Source=" + sqlServer + ";Initial Catalog=" + database + ";Integrated Security=SSPI;Provider=SQLOLEDB";
sqlConnection.Open(connectionString);
var result = new ActiveXObject("ADODB.Recordset");
result.Open("select TOP(1) ServerRemoteName from sysreslist where RoleName = 'SMS Site Server' and SiteCode = '" + parentSiteCode + "'", sqlConnection);
result.MoveFirst;
while (!result.eof) {
parentSiteServer = result.fields(0).Value;
result.MoveNext;
}
result.close;
sqlConnection.close;
}

siteWmi = $.Import("WMI").TryConnect(parentSiteServer, "root\\sms");
if (siteWmi === undefined) {
return undefined;
}

// now we have connected to parent site's 'root\sms'
siteWmi("SMS_ProviderLocation").Where("SiteCode = '" + parentSiteCode + "'").each(function () {
providerLocation = this.Machine;
sdkProv = $.Import("WMI").Connect(providerLocation, "root\\sms\\site_" + parentSiteCode);
return false;
});
}
else {
// now we have connected to 'root\sms'
siteWmi("SMS_ProviderLocation").Where("SiteCode = '" + siteCode + "'").each(function () {
providerLocation = this.Machine;
sdkProv = $.Import("WMI").Connect(providerLocation, "root\\sms\\site_" + siteCode);
return false;
});
}

return sdkProv.extend({
SiteCode: siteCode,
SiteServer: siteServer,
SiteId: siteId,
ProviderLocation: providerLocation,
ResolveServerFqdn: function (serverName, remoteServerName) {
if (serverName.indexOf(".") &gt; 0) {
return serverName;
}
else {
return remoteServerName;
}
}
});
});

$.Export("CIMv2", function () {
var cimWmi = $.Import("WMI").Connect(siteServer, "root\\cimv2");
var defaultWmi = $.Import("WMI").Connect(siteServer, "root\\default");

var HKLM = 0x80000002;

return cimWmi.extend({
CurrentServer: siteServer,
GetRegistryStringValue: function (strKeyPath, strValueName) {

var value = defaultWmi("StdRegProv").Execute(
"GetStringValue",
function () {
this.sSubKeyName = strKeyPath;
this.sValueName = strValueName;

return this;
},
function () {
if (this.ReturnValue == 0) {
return this.sValue;
}
else {
return undefined;
}
});

return value;
}
});
});

})($, $.Import("Mom.ScriptAPI"));
(function ($, undefined) {
$.Export("ConfigMgr.RoleClassMap", function () {
var map = {};

// 0000
map["Secondary_Site_Server".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.SecondarySiteServer']$";
map["Primary_Site_Server".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.StandaloneSiteServer']$";
map["Peer_Site_Server".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.PeerSiteServer']$";
map["Central_Site_Server".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.CentralSiteServer']$";

map["ConfigMgr_SDK_Provider".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.SdkProvider']$";
map["SMS_Site_Component_Manager".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.SiteComponentManager']$";

// 01-05
map["SMS_ASYNC_RAS_SENDER".toUpperCase()] = undefined;
map["SMS_Client_Access_Point".toUpperCase()] = undefined;
map["SMS_Component_Server".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.ComponentServer']$";
map["SMS_Device_Management_Point".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.DeviceManagementPoint']$";
map["SMS_Distribution_Point".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.DistributionPoint']$";

// 06-10
map["SMS_Fallback_Status_Point".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.FallbackStatusPoint']$";
map["SMS_LAN_SENDER".toUpperCase()] = undefined;
map["SMS_Management_Point".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.ManagementPoint']$";
map["SMS_PXE_Service_Point".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.PxeServicePoint']$";
map["SMS_RAS_SENDER".toUpperCase()] = undefined;

// 11-15
map["SMS_Server_Locator_Point".toUpperCase()] = undefined;
map["SMS_Site_Server".toUpperCase()] = undefined;
map["SMS_Site_System".toUpperCase()] = undefined;
map["SMS_SQL_Server".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.SqlServer']$";
map["SMS_State_Migration_Point".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.StateMigrationPoint']$";

// 16-20
map["SMS_System_Health_Validator".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.SystemHealthValidator']$";
map["SMS_Software_Update_Point".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.SoftwareUpdatePoint']$";
map["AI_Update_Service_Point".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.AIUpdateServicePoint']$";
map["SMS_Multicast_Service_Point".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.MulticastServicePoint']$";
map["SMS_AMT_Service_Point".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.AmtServicePoint']$";

// 21-25
map["Virtual_Application_Server".toUpperCase()] = undefined;
map["SMS_SRS_Reporting_Point".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.SrsReportingPoint']$";
map["SMS_Application_Web_Service".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.ApplicationWebService']$";
map["SMS_Portal_Web_Site".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.PortalWebSite']$";
map["SMS_Enrollment_Server".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.EnrollmentPoint']$";

// 26+
map["SMS_Enrollment_Web_Site".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.EnrollmentProxyPoint']$";
map["SMS_Endpoint_Protection_Point".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.EndpointProtection']$";
map["SMS_Dmp_Connector".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.MicrosoftIntuneConnector']$";

return $.extend(function (name) {
return map[name.replace(/\s+/g, "_").toUpperCase()];
}, this);
});
})($);

(function ($, undefined) {
$.Export("ConfigMgr.RoleDisplayName", function () {
var map = {};

// 0000
map["Secondary_Site_Server".toUpperCase()] = "ConfigMgr Secondary Site Server";
map["Primary_Site_Server".toUpperCase()] = "ConfigMgr Primary Site Server";
map["Peer_Site_Server".toUpperCase()] = "ConfigMgr Primary Site Server";
map["Central_Site_Server".toUpperCase()] = "ConfigMgr Central Site Server";

map["ConfigMgr_SDK_Provider".toUpperCase()] = "ConfigMgr SDK Provider";
map["SMS_Site_Component_Manager".toUpperCase()] = "ConfigMgr Site Component Manager";

// 01-05
map["SMS_ASYNC_RAS_SENDER".toUpperCase()] = undefined;
map["SMS_Client_Access_Point".toUpperCase()] = undefined;
map["SMS_Component_Server".toUpperCase()] = "ConfigMgr Component Server";
map["SMS_Device_Management_Point".toUpperCase()] = "ConfigMgr Mobile device management point";
map["SMS_Distribution_Point".toUpperCase()] = "ConfigMgr Distribution Point";

// 06-10
map["SMS_Fallback_Status_Point".toUpperCase()] = "ConfigMgr Fallback status point";
map["SMS_LAN_SENDER".toUpperCase()] = undefined;
map["SMS_Management_Point".toUpperCase()] = "ConfigMgr Management point";
map["SMS_PXE_Service_Point".toUpperCase()] = "ConfigMgr PXE service point";
map["SMS_RAS_SENDER".toUpperCase()] = undefined;

// 11-15
map["SMS_Server_Locator_Point".toUpperCase()] = "ConfigMgr Server locator point";
map["SMS_Site_Server".toUpperCase()] = undefined;
map["SMS_Site_System".toUpperCase()] = undefined;
map["SMS_SQL_Server".toUpperCase()] = "ConfigMgr Site database server";
map["SMS_State_Migration_Point".toUpperCase()] = "ConfigMgr State migration point";

// 16-20
map["SMS_System_Health_Validator".toUpperCase()] = "ConfigMgr System Health Validator point";
map["SMS_Software_Update_Point".toUpperCase()] = "ConfigMgr Software update point";
map["AI_Update_Service_Point".toUpperCase()] = "ConfigMgr Asset Intelligence Synchronization";
map["SMS_Multicast_Service_Point".toUpperCase()] = "ConfigMgr Multicast service point";
map["SMS_AMT_Service_Point".toUpperCase()] = "ConfigMgr Out of band service point";

// 21-25
map["Virtual_Application_Server".toUpperCase()] = undefined;
map["SMS_SRS_Reporting_Point".toUpperCase()] = "ConfigMgr Reporting services point";
map["SMS_Application_Web_Service".toUpperCase()] = "ConfigMgr Application Catalog web service";
map["SMS_Portal_Web_Site".toUpperCase()] = "ConfigMgr Application Catalog web site";
map["SMS_Enrollment_Server".toUpperCase()] = "ConfigMgr Enrollment point";

// 26+
map["SMS_Enrollment_Web_Site".toUpperCase()] = "ConfigMgr Enrollment proxy point";
map["SMS_Endpoint_Protection_Point".toUpperCase()] = "ConfigMgr Endpoint Protection Point";
map["SMS_Dmp_Connector".toUpperCase()] = "ConfigMgr Microsoft Intune Connector";

return $.extend(function (name) {
return map[name.replace(/\s+/g, "_").toUpperCase()];
}, this);
});
})($);
(function ($, undefined) {
$.Export("ConfigMgr.ComponentClassNames", function () {
var map = {};

map["SMS_COMPONENT_MONITOR".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.ComponentMonitor']$";
map["SMS_COMPONENT_STATUS_SUMMARIZER".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.ComponentStatusSummarizer']$";
map["SMS_DATABASE_NOTIFICATION_MONITOR".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.DatabaseNotificationMonitor']$";
map["SMS_DISTRIBUTION_MANAGER".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.DistributionManager']$";

map["SMS_INBOX_MANAGER".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.InboxManager']$";
map["SMS_INBOX_MONITOR".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.InboxMonitor']$";
map["SMS_LAN_SENDER".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.LanSender']$";

map["SMS_MP_CONTROL_MANAGER".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.ManagementPointControlManager']$";
map["SMS_MP_FILE_DISPATCH_MANAGER".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.FileDispatchManager']$";
map["SMS_OFFER_STATUS_SUMMARIZER".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.OfferStatusSummarizer']$";
map["SMS_OUTBOX_MONITOR".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.OutboxMonitor']$";

// this is a site role, not a component
map["SMS_SITE_COMPONENT_MANAGER".toUpperCase()] = undefined;
map["SMS_SITE_SYSTEM_STATUS_SUMMARIZER".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.SiteSystemStatusSummarizer']$";
map["SMS_STATE_MIGRATION_POINT".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.StateMigrationPointControlManager']$";
map["SMS_STATE_SYSTEM".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.StateSystem']$";

map["SMS_WAKEONLAN_MANAGER".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.WakeOnLanManager']$";

map["SMS_WSUS_CONFIGURATION_MANAGER".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.WsusConfigurationManager']$";
map["SMS_WSUS_SYNC_MANAGER".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.WsusSyncManager']$";
map["SMS_WSUS_CONTROL_MANAGER".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.WsusControlManager']$";

map["SMS_DMP_DOWNLOADER".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.DmpDownloader']$";
map["SMS_DMP_UPLOADER".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.DmpUploader']$";
map["SMS_CLOUD_USERSYNC".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.CloudUserSync']$";
map["SMS_OUTGOING_CONTENT_MANAGER".toUpperCase()] = "$MPElement[Name='SCCM!Microsoft.SystemCenter2012.ConfigurationManager.OutgoingContentManager']$";

return $.extend(function (name) {
return map[name.replace(/\s+/g, "_").toUpperCase()];
}, this);
});
})($);

(function ($, undefined) {
$.Export("ConfigMgr.ComponentDisplayNames", function () {
var map = {};

map["SMS_COMPONENT_MONITOR".toUpperCase()] = "ConfigMgr Component Monitor"
map["SMS_COMPONENT_STATUS_SUMMARIZER".toUpperCase()] = "ConfigMgr Component Status Summarizer"
map["SMS_DATABASE_NOTIFICATION_MONITOR".toUpperCase()] = "ConfigMgr Database Notification Monitor";
map["SMS_DISTRIBUTION_MANAGER".toUpperCase()] = "ConfigMgr Distribution Manager";

map["SMS_INBOX_MANAGER".toUpperCase()] = "ConfigMgr Inbox Manager"
map["SMS_INBOX_MONITOR".toUpperCase()] = "ConfigMgr Inbox Monitor"
map["SMS_LAN_SENDER".toUpperCase()] = "ConfigMgr Standard Sender";

map["SMS_MP_CONTROL_MANAGER".toUpperCase()] = "ConfigMgr MP Control Manager";
map["SMS_MP_FILE_DISPATCH_MANAGER".toUpperCase()] = "ConfigMgr File Dispatch Manager"
map["SMS_OFFER_STATUS_SUMMARIZER".toUpperCase()] = "ConfigMgr Deployment Status Summarizer"
map["SMS_OUTBOX_MONITOR".toUpperCase()] = "ConfigMgr Outbox Monitor"

map["SMS_SITE_COMPONENT_MANAGER".toUpperCase()] = undefined;
map["SMS_SITE_SYSTEM_STATUS_SUMMARIZER".toUpperCase()] = "ConfigMgr Site System Status Summarizer";
map["SMS_STATE_MIGRATION_POINT".toUpperCase()] = "ConfigMgr State Migration Point";
map["SMS_STATE_SYSTEM".toUpperCase()] = "ConfigMgr State System";

map["SMS_WAKEONLAN_MANAGER".toUpperCase()] = "ConfigMgr Wake on Lan Manager";

map["SMS_WSUS_CONFIGURATION_MANAGER".toUpperCase()] = "ConfigMgr WSUS Configuration Manager";
map["SMS_WSUS_SYNC_MANAGER".toUpperCase()] = "ConfigMgr WSUS Synchronization Manager";
map["SMS_WSUS_CONTROL_MANAGER".toUpperCase()] = "ConfigMgr WSUS Control Manager";

map["SMS_DMP_DOWNLOADER".toUpperCase()] = "ConfigMgr Intune Dmp Downloader";
map["SMS_DMP_UPLOADER".toUpperCase()] = "ConfigMgr Intune Dmp Uploader";
map["SMS_CLOUD_USERSYNC".toUpperCase()] = "ConfigMgr Intune Cloud User Sync";
map["SMS_OUTGOING_CONTENT_MANAGER".toUpperCase()] = "ConfigMgr Intune Outgoing Content Manager";

return $.extend(function (name) {
return map[name.replace(/\s+/g, "_").toUpperCase()];
}, this);
});
})($);
// Script below this line is the customized discovery logic
// --------------------------------------------------------

$Config/ScriptBody$

</Script></ScriptBody>
<SecureInput>$Config/SecureInput$</SecureInput>
<TimeoutSeconds>$Config/TimeoutSeconds$</TimeoutSeconds>
<EventPolicy>$Config/EventPolicy$</EventPolicy>
</ProbeAction>
</MemberModules>
<Composition>
<Node ID="PA"/>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.Discovery.Data</OutputType>
<InputType>System!System.BaseData</InputType>
</ProbeActionModuleType>