Re: Export AD information into a SQL Database



On Fri, 3 Feb 2006 04:44:37 -0800, Gareth Saunders <GarethSaunders@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

Hi there

We're looking to import user and computer information from AD into an SQL
Database. We currently have in excess of 900 user accounts and need to check
which users have which login scripts. Short of scrolling through 900+
accounts, we'd like to be able to import this information into an SQL
database. We've found some information which will import username etc, but
nothing on importing information like Login Scripts etc.

Many thanks in advance

Gareth Saunders
BOFH

See tip 5898 » Freeware ADFind.
in the 'Tips & Tricks' at http://www.jsifaq.com

See tip 7714 » What attribute names can I use with the user filtered dsquery command?

ADFIND -default -nodn -csv -csvdelim ; -nocsvheader -f "&(objectcategory=person)(objectClass=user)" distinguishedName sAMAccountName userPrincipalName displayName homeDirectory homeDrive scriptPath

and any other attribute you wish to export in a CSV format.

Here is just one of the many records exported from my test AD:

"CN=test,CN=Users,DC=JSIINC,DC=COM";"test";"test@xxxxxxxxxx";"First Last";"\\newserver\share\test";"H:";"logon.bat"

Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
http://www.jsifaq.com
.



Relevant Pages

  • Re: VPN over wireless
    ... Do you want to give the students user accounts so that they can access LAN ... Is the database forms they input to connected to the SQL server? ... I am setting up a separate network for Guest access using a wireless ...
    (microsoft.public.windows.server.sbs)
  • Re: SSMS problem PS
    ... Could you tell me how to get a user accounts back on SQL 2005? ... I see no way of doing it and I got a web site that hs been down for 2 days because it no longer has a user account for the database. ... I have both VS and SSMS on a number of machines, and I don't use VS to manage my databases. ...
    (microsoft.public.sqlserver.tools)
  • Re: Copy protection of files on Server
    ... > own native security (has its own user accounts), and it can also use Local ... > But you need to ask people who know what they are talking about with SQL ... database can be used and what can be done with it. ...
    (microsoft.public.security)
  • Re: SQL Server or IIS
    ... > user accounts to authenticate to SQL when they access the ... > database over the web. ... > is the database that locks them out or IIS. ...
    (microsoft.public.sqlserver.security)
  • Re: dbdebunk Quote of Week comment
    ... > a lot of really bad SQL programmers. ... But SQL does not have a pointer data type or the ... > being told to design a database. ... But why is little Cindy Lou Who employee ...
    (comp.databases.theory)