Skip to content

๐ŸŒ Domains

What is a domain?

First of all, what we have been calling an Active Directory network is what is usually known as aย Domain. A domain is a set of connected computers that shares an Active Directory database, which is managed by the central servers of a domain, that are calledย Domain Controllers.

Domain name

Each domain has a DNS name. In many companies, the name of the domain is the same as their web site, for exampleย etherdrake.com, while others have a different internal domain such asย etherdrake.local.

PS C:\Users\User> $env:USERDNSDOMAIN
ETHERDRAKE.LOCAL
PS C:\Users\User> (Get-ADDomain).DNSRoot
etherdrake.local

Identify current user domain from Powershell

PS C:\Users\User> (Get-WmiObject Win32_ComputerSystem).Domain
etherdrake.local

Identify current computer domain from Powershell

In addition to itsย DNS name, every domain can also be identified with NetBIOS name. For example, the domainย etherdrake.localย could have theย NetBIOS nameย ETHERDRAKE. You can see the NetBIOS name being used in log in operations, where the user is identified with something likeย ETHERDRAKE\Administrator, where the first part is the NetBIOS name and the second one is the username.

Finally, a domain can be identified by itsย SIDย (Security Identifier). The SID is more used by programs (using the Windows API) than users, but you should know how to obtain it in case you require it.

PS C:\Users\User> Get-ADDomain | select DNSRoot,NetBIOSName,DomainSID

DNSRoot       NetBIOSName DomainSID
-------       ----------- ---------
etherdrake.local ETHERDRAKE     S-1-5-21-1372086773-2238746523-2939299801

Get DNS name, NetBIOS name and SID of domain