KBI 311691 $PSPlayer.TargetServer In PowerShell Script Rule Returns IP Address Instead Of Hostname
Version
Argent Advanced Technology – All Versions
Date
Friday, 20 July 2018
Summary
The PowerShell script expects the built in variable ‘$PSPlayer.TargetServer’ to return the hostname where as it actually returns the IP address
Technical Background
The Node Properties window of the License Manager screen has an option to specify Alternate IP
This is primarily useful in connecting to servers or devices in a different domain or when the node name specified, fails to get resolved by the DNS
If Alternate IP is specified, the built in variable ‘$PSPlayer.TargetServer’ in PowerShell script Rules returns the IP address
Else, it returns the hostname
Resolution
Follow the steps below to resolve the issue
- Remove the IP address from ‘Alternate IP’ field
- Click on ‘Connectivity Test’ button to ensure the connection can be established even without specifying the IP address
If the connectivity test is successful, ‘$PSPlayer.TargetServer’ will return the hostname
- If the connectivity test fails, enter the IP address back in ‘Alternate IP’ field and modify the PowerShell script to handle both IP address and hostname