#title AD계정조회 {{{ select replace(substring(DistinguishedName, 1, charindex(',', DistinguishedName)-1), 'CN=', '') 이름 , SamAccountName ID , mail , cn , co from OPENROWSET( 'ADsDSOObject' , 'User ID=도메인\계정;Password=패스워드;ADSI Flag=0x11;Page Size=10000' , 'select SamAccountName, DistinguishedName, mail, cn, co from ''LDAP://도메인/OU=오유,OU=OU,DC=도메인,DC=COM''' ) a where 1=1 and DistinguishedName like '%이재학%' }}} * [http://www.kouti.com/tables/userattributes.htm User Attributes - Inside Active Directory] * [http://www.computerperformance.co.uk/Logon/LDAP_attributes_active_directory.htm Research LDAP* Properties for the User Object] openrowset으로 잘 안되면, linked server 세팅하고 openquery 해라.