PowerShell Logo Small

Get-ADDomain



This is the built-in help made by Microsoft for the command 'Get-ADDomain', in PowerShell version 5 - as retrieved from Windows version 'Microsoft Windows Server 2012 R2 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Gets an Active Directory domain.

SYNTAX


Get-ADDomain [-AuthType {Negotiate | Basic}] [-Credential <PSCredential>] [-Current {LocalComputer | LoggedOnUser}] [-Server <String>] [<CommonParameters>]
Get-ADDomain [-Identity] <ADDomain> [-AuthType {Negotiate | Basic}] [-Credential <PSCredential>] [-Server <String>] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Get-ADDomain cmdlet gets the Active Directory domain specified by the parameters. You can specify the domain by setting the Identity or Current parameters.


The Identity parameter specifies the Active Directory domain to get. You can identify the domain object to get by its Distinguished Name (DN), GUID, Security Identifier
(SID), DNS domain name, or NetBIOS name. You can also set the parameter to a domain object variable, such as $<localDomainObject> or pass a domain object through the
pipeline to the Identity parameter.


To get the domain of the local computer or current logged on user (CLU) set the Current parameter to LocalComputer or LoggedOnUser. When you set the Current parameter, you
do not need to set the Identity parameter.


When the Current parameter is set to LocalComputer or LoggedOnUser, the cmdlet uses the Server and Credential parameters according to the following rules.


- If both the Server and Credential parameters are not specified:


-- The domain is set to the domain of the LocalComputer or LoggedOnUser and a server is located in this domain. The credentials of the current logged on user are used to get
the domain.


- If the Server parameter is specified and the Credential parameter is not specified:


-- The domain is set to the domain of the specified server and the cmdlet checks to make sure that the server is in the domain of the LocalComputer or LoggedOnUser. Then the
credentials of the current logged on user are used to get the domain. An error is returned when the server is not in the domain of the LocalComputer or LoggedOnUser.


- If the Server parameter is not specified and the Credential parameter is specified:


-- The domain is set to the domain of the LocalComputer or LoggedOnUser and a server is located in this domain. Then the credentials specified by the Credential parameter
are used to get the domain.


- If the Server and Credential parameters are specified:


-- The domain is set to the domain of the specified server and the cmdlet checks to make sure that the server is in the domain of the LocalComputer or LoggedOnUser. Then the
credentials specified by the Credential parameter are used to get the domain. An error is returned when the server is not in the domain of the LocalComputer or LoggedOnUser.



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/p/?linkid=291025
Set-ADDomain
Set-ADDomainMode

REMARKS

<

Examples


-------------------------- EXAMPLE 1 --------------------------

PS C:\>Get-ADDomain -Identity fabrikam.com



This command gets the domain information for the domain fabrikam.com.




-------------------------- EXAMPLE 2 --------------------------

PS C:\>Get-ADDomain -Current LocalComputer



This command gets the domain information of the current local computer domain.




-------------------------- EXAMPLE 3 --------------------------

PS C:\>Get-ADDomain -Current LoggedOnUser



This command gets the domain information for the domain of the currently logged on user.




-------------------------- EXAMPLE 4 --------------------------

PS C:\>Get-ADDomain
AllowedDNSSuffixes : {}
ChildDomains : {}
ComputersContainer : CN=Computers,DC=Fabrikam,DC=com
DeletedObjectsContainer : CN=Deleted Objects,DC=Fabrikam,DC=com
DistinguishedName : DC=Fabrikam,DC=com
DNSRoot : Fabrikam.com
DomainControllersContainer : OU=Domain Controllers,DC=Fabrikam,DC=com
DomainMode : Windows2003Domain
DomainSID : S-1-5-21-41432690-3719764436-1984117282
ForeignSecurityPrincipalsContainer : CN=ForeignSecurityPrincipals,DC=Fabrikam,DC=com
Forest : Fabrikam.com
InfrastructureMaster : Fabrikam-DC1.Fabrikam.com
LastLogonReplicationInterval :
LinkedGroupPolicyObjects : {CN={31B2F340-016D-11D2-945F-00C04FB984F9},CN=Policies,CN=System,DC=Fabrikam,DC=com}
LostAndFoundContainer : CN=LostAndFound,DC=Fabrikam,DC=com
ManagedBy :
Name : Fabrikam
NetBIOSName : FABRIKAM
ObjectClass : domainDNS
ObjectGUID : b63b4f44-58b9-49cf-8911-b36e8575d5eb
ParentDomain :
PDCEmulator : Fabrikam-DC1.Fabrikam.com
QuotasContainer : CN=NTDS Quotas,DC=Fabrikam,DC=com
ReadOnlyReplicaDirectoryServers : {CSD2722780.Fabrikam.com}
ReplicaDirectoryServers : {Fabrikam-DC1.Fabrikam.com}
RIDMaster : Fabrikam-DC1.Fabrikam.com
SubordinateReferences : {DC=ForestDnsZones,DC=Fabrikam,DC=com, DC=DomainDnsZones,DC=Fabrikam,DC=com, CN=Co
nfiguration,DC=Fabrikam,DC=com}
SystemsContainer : CN=System,DC=Fabrikam,DC=com
UsersContainer : CN=Users,DC=Fabrikam,DC=com



This command gets the domain information for the domain of the currently logged on user.