0
我正在尋找一種方法來識別屬於少數組(a,b,c)中的一員的用戶,但也不在特定組中組(d),一個異常組,稍後對它們執行一些任務(根據samaccountname的值填寫特定屬性)。檢查是否屬於組中的成員,但不在一個特定組中的用戶
現在,我設法列出誰是特定組的成員的用戶帳戶,並按照其智能卡強制假的另一個條件:
$groups = "a","b","c"
foreach ($group in $groups) {
Get-ADGroupMember -Identity $group |
Get-ADUser -Properties 'smartcardlogonrequired' |
where {$_.smartcardlogonrequired -eq $false}
}
我認爲以下。 通過
$exceptions = (Get-ADGroup 'd').distinguishedname
foreach ($group in $groups) {
Get-ADGroupMember -Identity $group |
Get-ADUser -Properties 'smartcardlogonrequired' |
where {$_.smartcardlogonrequired -eq $false} |
Get-ADUser –Filter {-not(memberof –eq $d}
}
定義例外的組然而,它並沒有真正做的伎倆,和我確定那裏有一個更好的辦法。
就像一個魅力!謝謝! – BoleslawA
Ansgar,您是否碰巧遇到了某個挑戰,可以與我聊天?:)我可以以某種方式通過電子郵件或一些消息與您聯繫嗎? – BoleslawA
聯繫信息可以在我的主頁上找到(鏈接位於我的[SO個人資料](https://stackoverflow.com/users/1630171?tab=profile))。 –