Is there a universal way to get the principals BUILTIN\Users
or BUILTIN\Power Users
(specifically retrieve the name)
The obvious answer would be that I already have the names! However, they are called different things in different languages, so I'd like to find a way of retrieving this information without having to know the name in advance.
I've tried, in MS SQL
select * from sys.database_principals
which gives me the name and principal_id amongst other things
name principal_id type type_desc default_schema_name
BUILTIN\Power Users 7 G WINDOWS_GROUP dbo
BUILTIN\Users 8 G WINDOWS_GROUP dbo
... but I'm assuming that these principal_id
s aren't hard-coded and I can't rely on them always being 7 and 8