How to get users from Active Directory, mail them in an Insert trigger

  • Hello,

    I have one assignment like follows.

    I have Active Direcory Services installed in one of the Primary Domain Controller ABC, and SQL Server 2000 in an another System XYZ.

    Write an insert trigger which gets users from Active Directory and mail them about a new record has been added.

    I tried with adding Linked server,

    EXEC sp_addlinkedserver 'ADSI', 'Active Directory Services 2.5',

    'ADSDSOObject', 'adsdatasource'

    GO

    CREATE VIEW viewADContacts

    AS

    SELECT [Name], SN [Last Name]

    FROM OPENQUERY( ADSI,

       'SELECT Name, SN

       FROM ''LDAP://ADSISrv:389/ OU=Bangalore,DC=www,DC=company,DC=com''

       WHERE objectCategory = ''Person'' AND

          objectClass = ''user''')

    GO

    SELECT * FROM viewADContacts

    I would appreciate your suggetions at the earliest.

    Regards, BN

  • What error are you getting?

    K. Brian Kelley
    @kbriankelley

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply