locked
Local Domain availability RRS feed

  • Question

  • Hi All,

    I need to know if we can determines if we are connected with Ethernet Cable from a certain doamin, for example TestDomain.local (PC is NOT a member of domain yet, but just pluged in network Cable from that doamin)

    If Ethernet Cable is present, and domain is correct, then I can perform Task1 else I can perform Task2.

    Thanks in advance.


    N.A.Malik



    • Edited by N A Malik Friday, December 26, 2014 10:59 PM
    Friday, December 26, 2014 10:27 PM

Answers

All replies

  • Ping testdomain.local

    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

    Friday, December 26, 2014 10:31 PM
    Moderator
  • Hi,

    Thanks for reply, but PING requestes are declined by server. OR server is configured to ignore the ping requests.


    N.A.Malik

    Friday, December 26, 2014 10:58 PM
  • nelookup  testdomain.local

    If this doesn't work you cannot connect to or join the domain.  This requires that theDNS servers for the domina be available.  If they are no then the PC is not conencted or the domian is not funcionaing.

    None of this has anything to do with scripting.


    ¯\_(ツ)_/¯

    Friday, December 26, 2014 11:11 PM
  • Hi JRV

    Please note that PC is NOT joined to domain yet, but just connected with Ethernet Cable. And IP address on that Ethernet Cable is from the AD DS (testdomain.local)


    N.A.Malik

    Friday, December 26, 2014 11:59 PM
  • Hi,

    Thanks for reply, but PING requestes are declined by server. OR server is configured to ignore the ping requests.


    N.A.Malik

    What matters is whether it will resolve.

     If it will resolve to an IP address, then you're on a network, and using a DNS server that knows about that domain.  


    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

    • Proposed as answer by jrv Saturday, December 27, 2014 12:43 AM
    Saturday, December 27, 2014 12:29 AM
    Moderator
  • nslookup will tell you if the domain is visible.  THere is really no other way if CMP is blocked at the DC.

    It would be helpful if you explained why you need to do this.


    ¯\_(ツ)_/¯

    Saturday, December 27, 2014 12:42 AM
  • I need to run a bat file only if PC is connected to mydomain.local with Ethernet Cable.

    Thats why I am looking for a way to make it so called check with IF ELSE if connected, do this if not, do something else.


    N.A.Malik

    Saturday, December 27, 2014 10:26 AM
  • I need to run a bat file only if PC is connected to mydomain.local with Ethernet Cable.

    Thats why I am looking for a way to make it so called check with IF ELSE if connected, do this if not, do something else.


    N.A.Malik

    Apparently you've decided that some sort of script is going to provide a solution, given that you've posted the question in this forum. 

    We'll try to answer your scripting questions, but so far you haven't asked any. We don't know what scripting language or languages you're prepared to deal with, or shown any indication you've actually tried  anything on your own to accomplish this.



    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "


    Saturday, December 27, 2014 2:43 PM
    Moderator
  • Reason to ask /pst in this forum if there exist a sort of powershell script that can do this (and I got nslookup hint so far)

    If you cant answer this question, leave this, no one is forcing you to answer it.


    N.A.Malik

    Saturday, December 27, 2014 3:09 PM
  • Reason to ask /pst in this forum if there exist a sort of powershell script that can do this (and I got nslookup hint so far)

    If you cant answer this question, leave this, no one is forcing you to answer it.


    N.A.Malik

    https://social.technet.microsoft.com/Forums/en-US/a0def745-4831-4de0-a040-63b63e7be7ae/posting-guidelines?forum=ITCG

    https://social.technet.microsoft.com/Forums/en-US/ff3f3b21-8ed5-47b0-bc30-5ca3bbe91029/handy-tips-for-posting-to-this-forum?forum=ITCG


    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

    Saturday, December 27, 2014 4:07 PM
    Moderator
  • Just check the returned value to see if it retrieved a bvalue.

    You can try [System.Net.Dns]::GetHostByName('domain.com')

    You can just check for a returned value.


    ¯\_(ツ)_/¯

    Saturday, December 27, 2014 4:57 PM