Here is a tidier way to get the IP address:
Code:
$oWMI = GetObject("winmgmts:\\.\root\cimv2")
$colPings=$oWMI.ExecQuery("Select * From Win32_PingStatus where Address = '"+SubStr(%LOGONSERVER%,3)+"'")

For Each $oStatus in $colPings
"Logon server IP address: " $oStatus.ProtocolAddress ?
Next