Contained login (ad group) not showing

  • I have 2 server with WSFC on it, let's call them SRV1 en SRV2. SQL Server 2022 (16.0.4003.1) on it and made a contained availability group ContainedAG (SRV1 primary) and listener CAG1. Created a contained login from a group in the AD. When I do the following query from another server using linked server:

    SELECT name

    FROM [SRV1].[ContainedAG_master].[sys].[server_principals]

    WHERE type = 'G'

    My contained login is not showing. When I do the following query:

    SELECT name

    FROM [CAG1].[master].[sys].[server_principals]

    WHERE type = 'G'

    My contained login is showing. What am I missing? This should point to the same database or not?

    Furthermore If I query through SSMS and I start a tab using new query on SRV1, the following query is not showing the contained login:

    SELECT name

    FROM [ContainedAG_master].[sys].[server_principals]

    WHERE type = 'G'

    But when I start the tab on new query on ContainedAG_master the contained login is showing.

  • Did you enable contained db authentication at instance level?

    exec sp_configure 'show advanced', 1
    GO
    RECONFIGURE
    GO
    exec sp_configure 'contained database authentication', 1;
    GO
    RECONFIGURE;
    GO

    ( edited: added 'show advanced')

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • Yes, we enabled 'contained database authentication'. Accessing the databases through this contained login is also not a problem. But we are running some queries from time to time to get some inventory of our SQL Server farm. There queries gave strange results depending on how you query.

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

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