Get-DomainController
此 cmdlet 仅适用于本地 Exchange。
使用 Get-DomainController cmdlet 可以查看组织中存在的域控制器列表。
有关以下语法部分的参数设置的详细信息,请参阅 Exchange cmdlet 语法。
语法
GlobalCatalog
Get-DomainController
[-GlobalCatalog]
[-Forest <Fqdn>]
[-Credential <NetworkCredential>]
[<CommonParameters>]
DomainController
Get-DomainController
[-DomainName <Fqdn>]
[-Credential <NetworkCredential>]
[<CommonParameters>]
说明
exchange 管理中心使用 Get-DomainController cmdlet 来填充显示域控制器信息的字段。
您必须先获得权限,然后才能运行此 cmdlet。 尽管本文列出了 cmdlet 的所有参数,但如果某些参数未包含在分配给你的权限中,则可能无法访问这些参数。 若要查找在贵组织中运行任何 cmdlet 或参数所需的权限,请参阅 Find the permissions required to run any Exchange cmdlet。
示例
示例 1
$UserCredentials = Get-Credential
Get-DomainController -DomainName corp.contoso.com -Credential $UserCredentials | Format-Table -AutoSize Name,ADSite
本示例检索 corp.contoso.com 域中全局编录服务器的列表。 由于访问此域需要一组不同的凭据,因此使用 Get-Credential cmdlet 从用户获取用户名和密码。
第一个命令向接受用户名和密码的用户显示提示。 这些凭据随后存储在 $UserCredentials 变量中。 第二个命令使用 $UserCredentials 变量作为 Credential 参数值。 为了使列表可读性更强,输出内容将通过管道传递到 Format-Table cmdlet,并且只显示 Name 和 ADSite 属性。
参数
-Credential
适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE
Credential 参数指定用于运行此命令的用户名和密码。 通常情况下,您可以在脚本中或在需要提供具有所需权限的不同凭据时使用此参数。
必须先创建并传递凭据对象,然后才能使用此参数。 该凭据对象是使用 Get-Credential cmdlet 创建的。 有关详细信息,请参阅 Get-Credential。
如果使用 Forest 参数,则使用凭据访问林。
参数属性
| 类型: | NetworkCredential |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-DomainName
适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE
DomainName 参数指定要为其返回域控制器列表的域的完全限定的域名 (FQDN)。
参数属性
| 类型: | Fqdn |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
DomainController
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-Forest
适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE
Forest 参数指定要为其返回域控制器列表的林的根域的 FQDN。
参数属性
| 类型: | Fqdn |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
GlobalCatalog
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-GlobalCatalog
适用:Exchange Server 2010、Exchange Server 2013、Exchange Server 2016、Exchange Server 2019、Exchange Server SE
GlobalCatalog 开关指定命令是否应返回全局编录服务器列表。 不必为此开关指定值。
参数属性
| 类型: | SwitchParameter |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
GlobalCatalog
| Position: | Named |
| 必需: | True |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
CommonParameters
此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters。
输入
Input types
若要了解此 cmdlet 接受的输入类型,请参阅 cmdlet 的输入和输出类型。 如果 cmdlet 的"输入类型"字段为空,则表明此 cmdlet 不接受输入数据。
输出
Output types
若要了解此 cmdlet 接受的返回类型(亦称为"输出类型"),请参阅 cmdlet 的输入和输出类型。 如果"输出类型"字段为空,则表明此 cmdlet 不返回任何数据。