I have a scenario where a user can log in to SQL Server through their Windows group. The user has no login and there is no user in the database.
Then I would like to get the name of the window group through which the user gets logged in. However, suser_sname () returns the actual user name
suser_sid () does not help me.
Does anyone have to do this?
announcement @ user sinnee; SET @user = SUSER_SNAME (); Xc xp_logininfo @ user, 'all'; This user will return the rows for any group (in the rows permission path column will have zero-value) but this will be your own username (my case
You can return all the possible groups you see with the following question:
You will also return a line for permission path for that line). Can:
SELECT * master.sys.server_principals WHERE type = 'g'; - type_desc = 'WINDOWS_GROUP' sub Ogkrta be a member of another AD group that are not registered with SQL Server. You will be advertising for it.
No comments:
Post a Comment