How to Get user info from different domain
20,941
I typed Get-Help Get-ADUser -Full
and found the following:
-Server <string> Specifies the Active Directory Domain Services instance to connect to, by providing one of the following values for a corresponding domain name or directory server. The service may be any of the following: Active Director y Lightweight Domain Services, Active Directory Domain Services or Active Directory Snapshot instance. Domain name values: Fully qualified domain name Examples: corp.contoso.com NetBIOS name Example: CORP Directory server values: Fully qualified directory server name Example: corp-DC12.corp.contoso.com NetBIOS name Example: corp-DC12 Fully qualified directory server name and port Example: corp-DC12.corp.contoso.com:3268 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 "corp.contoso.com" Required? false Position? named Default value Accept pipeline input? false Accept wildcard characters? false
Is this what you're looking for??
Related videos on Youtube
Author by
user113784
Updated on September 18, 2022Comments
-
user113784 over 1 year
How to Get user info from different domain. Get-ADUser -Identity username work with same domain1 but i want to know user info from different child Domain
-
tony roth about 12 yearsdoesn't get-aduser have a domain opton also?
-
John Homer about 12 yearsThis should really be tagged as Powershell and ActiveDirectory.
-
-
user113784 about 12 yearsI have gone throw following syntex but i believe due to Active Directory Web Services not running it has no result (Get-ADgroupMember -Identity "DL Name" | Get-ADUser -Server "DomainA" | Set-ADUser -Manager "Manager name" ) , error that comes up (Get-ADUser " Unable to contact the server. this may be because this server no exist, it is currently down, or it does not have the active directory web services running)...
-
Nick Young over 8 yearsYou have a logic problem in that query. You querying the current domain for Get-ADgroupMember -Identity "DL Name" the other domain for Get-ADUser -Server "DomainA" and then the first again for Set-ADUser -Manager "Manager name" ) you need to use -server for all the requests.