Powershell Get ADUser分离过滤器
是否可以在过滤器中修改ADProperty? 我希望它的用途是能够检查特定OU中是否已经存在具有特定名称的用户。 大概是这样的:Powershell Get ADUser分离过滤器,powershell,active-directory,Powershell,Active Directory,是否可以在过滤器中修改ADProperty? 我希望它的用途是能够检查特定OU中是否已经存在具有特定名称的用户。 大概是这样的: $ou="HQOffice" Get-ADUser -Properties Displayname -Filter {Displayname -eq "Major Minor" -and (DistinguishedName).split(',')[2].split('=')[1] -eq $ou} 否,如果只希望在该OUNo中使用直接子对象,请使用-SearchB
$ou="HQOffice"
Get-ADUser -Properties Displayname -Filter {Displayname -eq "Major Minor" -and (DistinguishedName).split(',')[2].split('=')[1] -eq $ou}
否,如果只希望在该OUNo中使用直接子对象,请使用
-SearchBase
参数指定OU,并将-SearchScope
参数设置为OneLevel
,使用-SearchBase
参数指定OU,并将-SearchScope
参数设置为OneLevel
,前提是该OU中只需要立即子对象