DCTFUK
Starting Member
11 Posts |
Posted - 2014-11-17 : 10:45:43
|
These are the individual queriesThis one to list all users:SELECT sAMAccountname AS AccountName, GivenName AS [First Name], SN AS [Last Name], mail AS [E-mail Address], TelephoneNumber AS [Telephone Number], l AS Office, PostalAddress AS [Postal Address], PostalCode, StreetAddress AS [Street Address], wWWHomePage AS [Web Page], distinguishedname AS DN FROM OPENQUERY(ADSI, 'SELECT GivenName, SN, company, department, TelephoneNumber, mail, distinguishedname, title, l, manager, mobile, name, PhysicalDeliveryOfficeName, PostalAddress, PostalCode, sAMAccountname, StreetAddress, wWWHomePage FROM ''LDAP://dc=xxxxx,dc=local'' WHERE objectCategory = ''Person'' AND objectClass = ''user'' ORDER BY Name') Rowset_1And this one to list all groupsSELECT sAMAccountname AS AccountName, GivenName AS [First Name], SN AS [Last Name], mail AS [E-mail Address], TelephoneNumber AS [Telephone Number], l AS Office, PostalAddress AS [Postal Address], PostalCode, StreetAddress AS [Street Address], wWWHomePage AS [Web Page], distinguishedname AS DN FROM OPENQUERY(ADSI, 'SELECT GivenName, SN, company, department, TelephoneNumber, mail, distinguishedname, title, l, manager, mobile, name, PhysicalDeliveryOfficeName, PostalAddress, PostalCode, sAMAccountname, StreetAddress, wWWHomePage FROM ''LDAP://dc=xxxxxx,dc=local'' WHERE objectCategory = ''group'' AND objectClass = ''group'' ORDER BY Name') Rowset_1 |
|
|