gpt4 book ai didi

powershell - 在 powershell 中使用 get-aduser 指定域 Controller

转载 作者:行者123 更新时间:2023-12-03 16:40:44 28 4
gpt4 key购买 nike

Get-ADUser -identity $ntaccount1 -properties name, samaccountname, mail, enabled, passwordlastset

在 powershell 中查找用户帐户信息时,是否可以指定要使用的域 Controller ?我们有一些 DC 可以比其他 DC 更快地获取数据。

最佳答案

来自 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

关于powershell - 在 powershell 中使用 get-aduser 指定域 Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27362342/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com