Files
IVANTI/get-preferred-server
2025-10-31 08:38:13 +01:00
..
2025-10-31 08:38:13 +01:00

Retrieve the Preferred Server Based on the IP Address

GetMyPreferedServer Screenshot

This script allows you to identify the preferred server for a device, based on its IP address, by querying a central SQL database.


🔧 Configuration

Before using the script, update the following lines with your SQL connection details:

$dataSource = "InstanceSQL"
$user       = "SQLAccount"
$PassSQL    = "SQLPassword"
$database   = "DatabaseName"

Make sure the account has permission to query the relevant table containing IP/server associations