---
sourceDocument: Xanadu API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# MIDServerSelector - Global

# MIDServerSelector - Global {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

The MIDServerSelector script include provides methods to find a MID Server based on capabilities and target IP address.

Use in server scripts to find a MID Server with specific capabilities.

## MIDServerSelector - MIDServerSelector() {#ariaid-title2}

Creates an instance of MIDServerSelector.
{#r_MSSL-MIDServerSelector__table_txz_whm_zt__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 1. Parameters]

{#r_MSSL-MIDServerSelector__table_txz_whm_zt} {#r_MSSL-MIDServerSelector__table_uxz_whm_zt__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 2. Returns]

{#r_MSSL-MIDServerSelector__table_uxz_whm_zt}

## MIDServerSelector - findAgent(String target) {#ariaid-title3}

Finds the MID server based on the capabilities and target IP address.
{#r_MSSL-findAgent_S__table_pcv_gjm_zt__entry__3}

| Name | Type | Description |
|-|-|-|
| target | String | The target IP address |
[Table 3. Parameters]

{#r_MSSL-findAgent_S__table_pcv_gjm_zt} {#r_MSSL-findAgent_S__table_qcv_gjm_zt__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 4. Returns]

{#r_MSSL-findAgent_S__table_qcv_gjm_zt}  

    var mss = new MIDServerSelector();
    var capab = ["ssh","wmi","snmp"];
    mss.setCapabilities(capab);
    mss.findAgent('100.101.10.10');

## MIDServerSelector - getError() {#ariaid-title4}

Gets the error messages for the current MID server.
{#r_MSSL-getError__table_q21_z3m_zt__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 5. Parameters]

{#r_MSSL-getError__table_q21_z3m_zt} {#r_MSSL-getError__table_r21_z3m_zt__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 6. Returns]

{#r_MSSL-getError__table_r21_z3m_zt}  

    var mss = new MIDServerSelector();
    var capab = ["ssh","wmi","snmp"];
    mss.setCapabilities(capab);
    mss.findAgent('100.101.10.10');
    mss.getError();

## MIDServerSelector - getWarning() {#ariaid-title5}

Gets the warning messages for the current MID server.
{#r_MSSL-getWarning__table_jld_r3m_zt__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 7. Parameters]

{#r_MSSL-getWarning__table_jld_r3m_zt} {#r_MSSL-getWarning__table_kld_r3m_zt__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 8. Returns]

{#r_MSSL-getWarning__table_kld_r3m_zt}  

    var mss = new MIDServerSelector();
    var capab = ["ssh","wmi","snmp"];
    mss.setCapabilities(capab);
    mss.findAgent('100.101.10.10');
    mss.getWarning();

## MIDServerSelector - setCapabilities(Array capabilities) {#ariaid-title6}

Sets the technologies for which to look.
{#r_MSSL-setCapabilities_A__table_dtc_f3m_zt__entry__3}

| Name | Type | Description |
|-|-|-|
| capabilities | Array | A list of capabilities, for example - capabilities = \["ssh","wmi","snmp",{"os_domain":"disco"},{"phase":1}\]; |
[Table 9. Parameters]

{#r_MSSL-setCapabilities_A__table_dtc_f3m_zt} {#r_MSSL-setCapabilities_A__table_etc_f3m_zt__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 10. Returns]

{#r_MSSL-setCapabilities_A__table_etc_f3m_zt}  

    var mss = new MIDServerSelector();
    var capab = ["ssh","wmi","snmp"];
    mss.setCapabilities(capab);


