【发布时间】:2014-10-13 14:02:14
【问题描述】:
我想检查用户的组成员身份。组取自 ldap 并插入到域中。目前我尝试了这样的事情......
#Powershell.ps1
$CurrentUser = [System.Security.Principal.WindowsIdentity]::GetCurrent()
$wp = New-Object System.Security.Principal.WindowsPrincipal($CurrentUser)
# I have in my domain a group called 'dom_group'
if ( $wp.IsInRole('dom_group') ) {
"Expected to be true"
} else {
"Unexpected False"
}
#Unexpected False
很遗憾,这只适用于本地团体。
如何根据域组“dom_group”检查当前使用的组成员身份?
【问题讨论】:
标签: .net windows security powershell