Skip to content

Instantly share code, notes, and snippets.

@flickerfly
Last active December 15, 2015 09:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flickerfly/5240058 to your computer and use it in GitHub Desktop.
Save flickerfly/5240058 to your computer and use it in GitHub Desktop.
Get the name of the domain I'm on
#Put the domain of the computer this script is running on into the $domain variable
$domain = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain().Name
@flickerfly
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment