Best way to script checking whether a machine is on the corporate network

Posted by Ben on Server Fault See other posts from Server Fault or by Ben
Published on 2010-05-25T19:42:36Z Indexed on 2010/05/25 19:51 UTC
Read the original article Hit count: 312

Filed under:
|
|

I am writing a Powershell script to determine if a machine is on the corporate network. The machine may or may not be on the domain, so I want to check at "IP" level.

Have written something to check by pinging a couple of servers on a couple of different subnets (to get around the risk of someone being on another (external) subnet with a host on the same IP.)

Works, but it's a bit slow, and not especially "future-proof" - e.g. in 2 years time when I decomission the server it'll break.

Is there a way I can use the dns suffix being given by the local dhcp server?

Just direct me what I need to check - I can figure out the script.

Ta,

Ben

© Server Fault or respective owner

Related posts about ip

Related posts about dhcp