It is very likely to be a browser security related issue. Since yo can not rely on the client I would implement this redirection on server side. It looks that you are in a domain environment, thus you can easily check on server side if the computer is domain member or not.
But you can put it simply in a try catch block, like this:
function IP()
{
try
{
var net = new ActiveXObject("wscript.network");
alert(net.UserDomain+': '+net.ComputerName);
alert('SUCCESS');
}
catch ()
{
window.location.href="Welcome.aspx";
return true;
}
return false;
}