Answer the question
In order to leave comments, you need to log in
How to get information using PowerShell about an account in another domain?
The task is as follows, it is required to display information about accounts (with e-mail and not disabled) in another domain, there is trust between domains.
I enter the command:
Get-ADUser -Filter {(mail -ne "null") -and (Enabled -eq "true")} -Properties mail -SearchBase 'OU=FN,DC=tc,DC=xx,DC=local' -Server tc.xx.local | Select-Object Name,mail | Format-Table
Get-ADUser -Filter {(mail -ne "null") -and (Enabled -eq "true")} -Properties mail -SearchBase 'OU=test,DC=ct,DC=xx,DC=local' -Server 'ct.xx.local'| Select-Object Name,mail | Format-Table
Answer the question
In order to leave comments, you need to log in
You have the same dc name and search domain name. Most likely -SearchBase 'OU=FN,DC=xx,DC=local'.
When you request just any object from a neighboring domain, do you get anything? What mistake?
Vadim Choporov
When I try to get information from a neighboring domain, nothing happens, it just switches to a new line and there are no errors:
And if I enter in the current domain, I get the necessary information
I noticed now one moment, when I run the command:
An error appears: Get-ADDomain : Unable to establish a connection with the server. Possible causes: The server does not exist, is down, or is not running Active Directory Web Services.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question