Subscribe to Windows IT Pro

 

Get Newsletters

  • Get the Latest News
  • Product Updates
  • Helpful Tricks
  • Productivity Tips

Subscribe Now!

March 23, 2004 12:00 AM

Publishing SQL Server in Active Directory

Safely inform clients of SQL Server resources
SQL Server Pro
InstantDoc ID #41841
Rating: (1)
Downloads
41841.zip

If you've noticed the Active Directory tab under SQL Server Properties in Enterprise Manager, you might have wondered how Active Directory (AD) relates to SQL Server and what the benefits are of adding SQL Server and its databases to AD. Network services such as file and printer servers use AD to publish and store network resource information. AD contains a list of user accounts and a directory of available network resources.

Because AD considers SQL Servers and SQL Server databases to be network resources, you can list them in AD. In SQL Server 2000, Microsoft introduced the concept of publishing (i.e., listing) both SQL Server and its databases in AD on a Windows Server 2003 or Windows 2000 domain.

Some Microsoft products such as Microsoft Exchange 2000 are so tightly integrated with AD that they require AD just to function. SQL Server doesn't require AD (at least not yet), and simply listing SQL Server in AD doesn't produce any immediate benefits. Listing SQL Server databases in AD is useful only if you develop applications that can take advantage of the AD published databases. One main benefit of listing any resource in AD is AD's Service Publication feature. Service Publication enables applications to list the name and locations of services they provide, so clients can locate the applications' services dynamically. Service Publication and lookup gives administrators the flexibility to reconfigure servers without having to update clients.

This article describes how to register a SQL Server instance and a database in AD. In addition, it provides some practical examples that use ADO, SQL, and Active Directory Service Interface (ADSI) to query and update the AD catalog. (For more information about ADSI, see the sidebar "What Is ADSI?" on page 16.) We'll walk through an example of how to build a service publication for a SQL Server database so that clients can dynamically locate and connect to a SQL Server based solely on a database name.

Listing a SQL Server Database in AD
You can list a SQL Server database in AD either through Query Analyzer by using the system stored procedures sp_ActiveDirectory_SCP and sp_ActiveDirectory_Obj or through Enterprise Manager. To add SQL Server from Query Analyzer, run

EXEC sp_ActiveDirectory_SCP

To add SQL Server from Enterprise Manager, open Server Properties, select the Active Directory tab, and click Add, as Figure 1 shows.

After registering the SQL Server instance in AD, you can add databases by using the sp_ActiveDirectory_Obj procedure. For example, to add the Northwind database to AD, you'd run

EXEC sp_ActiveDirectory_Obj @Action = N'create',
   @ObjType = N'database',
   @ObjName = 'Northwind'

To add the Northwind database from Enterprise Manager, open Northwind Properties, select the Options tab, and click the List this database in Active Directory check box at the bottom of the screen, as Figure 2, page 16, shows.

Related Content:

ARTICLE TOOLS

Comments
  • Jarlath
    8 years ago
    Sep 26, 2004

    Just went back of back issues regarding AD, as there very little in SQL & AD BOL!

    The included Listings are priceless.


    Jasper

  • Ronny De Fonny
    8 years ago
    May 06, 2004

    very interesting!! thanks for the information

  • Paul Ritchie
    8 years ago
    Apr 19, 2004

    I am very dissapointed that I as a subscriber to SQL Server magazine should have to be subjected to flashing graphics when I am trying to read a useful article such as this. Even Printer Friendly still has a graphic there, flashing away. It's simply pollution that I don't expect to have to put up with. It didn't use to be there - in Print Preview mode anyway.

    And this comments box is too small, (and it's scroll bar doesn't work). Are you trying to shut me up?

    Thanks for listening.

    regards,
    Paul Ritchie

  • Roger Young
    8 years ago
    Apr 07, 2004

    The article cleared up some misconceptions about the AD configuration.

  • Glenda Baker
    8 years ago
    Mar 26, 2004

    If this does what I think it says it does, the possibilities are endless!

You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

White Papers

Get your Windows 7 deployment off to the right start by implementing PC lockdown. A locked-down environment is easier and cheaper to support since users are less likely to make unnecessary changes to the core system configuration - read more here!

Essential Guides

Is your iSCSI "lossy"? The reality is that most off-the-shelf Ethernet hardware deployed for iSCSI can lose packets, resulting in slow performance or application downtime. Learn how to assess your current iSCSI infrastructure and engineer an advanced iSCSI SAN infrastructure.

Web Seminars

What's the best way to keep your network safe from malware? In this web seminar, security expert Greg Shields suggests an alternative method to the traditional blacklisting approach that is common with anti-virus and anti-malware solutions.

eLearning Series

We bring the experts direct to you to share their real-world perspective and expertise. During each event, three sessions stream in real time, so you can learn, ask questions, and get solutions.
Upcoming event: Getting the Most with Exchange 2010 with Paul Robichaux

Subscribe to Windows IT Pro!

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.