Author Posts

January 1, 2012 at 12:00 am

by Christopher.Ellis at 2013-02-20 09:25:46

Within powershell – How can I determine which Active Directory Domain Controller is being polled for information?

for example C:> get-aduser christopher.ellis

DistinguishedName : CN=Christopher.Ellis,OU=Head Office – 2540
Enabled : True
GivenName : Christopher
Name : Christopher.Ellis
ObjectClass : user
ObjectGUID : 07ce018b-2fa5-4bf6-90df-3f7aa2818981
SamAccountName : Christopher.Ellis
SID : S-1-5-21-1140152784-10511339-5522801-6916
Surname : Ellis
UserPrincipalName :

Can I direct powershell to query a specific Domain controller? If so – how?

by AlexBrassington at 2013-02-20 10:57:00

To pick one you can use the Server parameter:

[quote]The default value for the Server parameter is determined by one of the following methods in the order that they are listed:
-By using Server value from objects passed through the pipeline.
-By using the server information associated with the Active Directory PowerShell provider drive, when running under that drive.
-By using the domain of the computer running Powershell.

The following example shows how to specify a full qualified domain name as the parameter value.
-Server ""

Directory server values:
Fully qualified directory server name
NetBIOS name
Example: corp-DC12
Fully qualified directory server name and port
[/quote] ... 17241.aspx

I don't know how you'd identify which server you're using by default though.