none
Determine if a Domain Computer is Connected to its Domain RRS feed

  • Question

  • From the workstation's perspective, what is the simplest way to determine if it's connected to its domain (i.e. it's not at home or in a coffee shop)?  Can it tell by the %logonserver% variable?  But how about machines that are taken away from it's domain network range, without a proper logoff, so that all variables will remain as if it's connected?
    Thursday, May 8, 2014 8:57 PM

Answers

  • This will also tell you the state of your connection.

    [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()


    ¯\_(ツ)_/¯

    Thursday, May 8, 2014 9:11 PM

All replies

  • Try to connect to a DC.


    ¯\_(ツ)_/¯

    Thursday, May 8, 2014 9:06 PM
  • This will also tell you the state of your connection.

    [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()


    ¯\_(ツ)_/¯

    Thursday, May 8, 2014 9:11 PM
  • This will also tell you the state of your connection.

    [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()


    ¯\_(ツ)_/¯

    Ah, you're right.  I use that many times for other things, not realizing it can be used this way.

    I'll use GetComputerDomain instead for my purpose.

    Thanks again.
    Thursday, May 8, 2014 9:33 PM