Adding ADSI LDAP server connection inside CMS collection?

  • Morning, all.

    Is there a way to query the LDAP from inside the CMS? I know I can add a linked server in a singular instance but I'd like to do it inside a server group. I haven't found anything so far about querying the LDAP inside a server group so it might not be possible?

    Erin :unsure:

  • What's the end goal here?

  • No. The linked server would have to exist with the same name on every server in the group.

    Edit: Of course, the query batch could create a linked server, use it, and then drop it.


    My blog: SQL Soldier[/url]
    SQL Server Best Practices:
    SQL Server Best Practices
    Twitter: @SQLSoldier
    My book: Pro SQL Server 2008 Mirroring[/url]
    Microsoft Certified Master: SQL Server, Data Platform MVP
    Database Engineer at BlueMountain Capital Management[/url]

  • mrdenny (6/17/2014)


    What's the end goal here?

    The ultimate goal is to verify that a given username exists in the ldap before querying a registered group looking for that username. Any alternate ideas? We currently user a variable containing the username but I wanted to be able to verify the information in that variable before querying the entire group.

    So we have a thought but it would require that we be able to pick the order in which the servers in a registered group are queried. Is that possible?

  • If I'm understanding you correctly, you can use the built-in function SUSER_SID() to verify if the account exist. If it returns NULL, it doesn't exist:

    Declare @User nvarchar(256) = N'SQLMCMLap\TestUser',

    @sid varbinary(85);

    Set @sid = SUSER_SID(@User);

    If @sid Is Not Null

    Begin

    --Do work

    End


    My blog: SQL Soldier[/url]
    SQL Server Best Practices:
    SQL Server Best Practices
    Twitter: @SQLSoldier
    My book: Pro SQL Server 2008 Mirroring[/url]
    Microsoft Certified Master: SQL Server, Data Platform MVP
    Database Engineer at BlueMountain Capital Management[/url]

Viewing 5 posts - 1 through 4 (of 4 total)

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