gpt4 book ai didi

Powershell where-object 语法 - 属性中的连字符

转载 作者:行者123 更新时间:2023-12-02 22:34:04 38 4
gpt4 key购买 nike

我正在使用以下内容仅针对相关用户。

Get-ADUser -Filter * -SearchBase $TargetOU -Properties * | Where-Object {$_.adminDescription -eq "Azure_Sync" -and $_.proxyAddresses -notlike "sip*" -and $_.sn -ne $null -and $_.msRTCSIP-PrimaryUserAddress -ne $null

但是,它不喜欢最后一个 $_.msRTCSIP-PrimaryUserAddress。 “-”在这里破坏了东西,所以我如何以与其他属性相同的方式使用这个属性?

最佳答案

您可以在属性周围添加引号,例如

$_."msRTCSIP-PrimaryUserAddress"

关于Powershell where-object 语法 - 属性中的连字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46548145/

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