且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Powershell中使用get-aduser指定域控制器

更新时间:2023-02-12 14:24:55

从Get-Help Get-ADUser -Parameter *

From Get-Help Get-ADUser -Parameter *

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