SELECT userPrincipalName email,sAMAccountName username, displayName
FROM OPENQUERY(ADSI,
'SELECT msExchHideFromAddressLists,userPrincipalName,displayName,sAMAccountName
FROM ''LDAP://domain.com/OU=組織單位,DC=domain,DC=com''
WHERE objectClass = ''User''
')
where msExchHideFromAddressLists is null or msExchHideFromAddressLists=0
※msExchHideFromAddressLists=1 表示信箱隱藏
AD 屬性列表
沒有留言:
張貼留言