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??

Share:
20,941

Related videos on Youtube

user113784
Author by

user113784

Updated on September 18, 2022

Comments

  • user113784
    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
      tony roth about 12 years
      doesn't get-aduser have a domain opton also?
    • John Homer
      John Homer about 12 years
      This should really be tagged as Powershell and ActiveDirectory.
  • user113784
    user113784 about 12 years
    I 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
    Nick Young over 8 years
    You 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.