You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Within the Get-DbaUserPermission.ps1 file it appears that the alias is missing from the third value of the $dbSQL resultset which causes the RoleSecureableClass to appear blank. I was able to confirm this issue exists in version 0.732. This issue was confirmed corrected by adjusting the T-SQL as below:
SELECT 'DB ROLE MEMBERS' AS type , Member , ISNULL(Role, 'None') AS [Role/Securable/Class] , --INSERTED PROPER ALIAS HERE ' ' AS [Schema/Owner] , ' ' AS [Securable] , ' ' AS [Grantee Type] , ' ' AS [Grantee] , ' ' AS [Permission] , ' ' AS [State] , ' ' AS [Grantor] , ' ' AS [Grantor Type] , ' ' AS [Source View] FROM tempdb.[STIG].[database_role_members] UNION SELECT DISTINCT 'DB SECURABLES' AS Type , ISNULL(drm.member, 'None') AS [Role/Securable/Class] , dp.[Securable Type or Class] COLLATE SQL_Latin1_General_CP1_CI_AS , dp.[Schema/Owner] , dp.Securable , dp.[Grantee Type] COLLATE SQL_Latin1_General_CP1_CI_AS , dp.Grantee , dp.Permission COLLATE SQL_Latin1_General_CP1_CI_AS , dp.State COLLATE SQL_Latin1_General_CP1_CI_AS , dp.Grantor , dp.[Grantor Type] COLLATE SQL_Latin1_General_CP1_CI_AS , dp.[Source View] FROM tempdb.[STIG].[database_role_members] drm LEFT JOIN tempdb.[STIG].[database_permissions] dp ON ( drm.member = dp.grantee OR drm.role = dp.grantee ) WHERE dp.Grantor IS NOT NULL AND [Schema/Owner] <> 'sys'
The text was updated successfully, but these errors were encountered:
Within the Get-DbaUserPermission.ps1 file it appears that the alias is missing from the third value of the $dbSQL resultset which causes the RoleSecureableClass to appear blank. I was able to confirm this issue exists in version 0.732. This issue was confirmed corrected by adjusting the T-SQL as below:
SELECT 'DB ROLE MEMBERS' AS type , Member , ISNULL(Role, 'None') AS [Role/Securable/Class] , --INSERTED PROPER ALIAS HERE ' ' AS [Schema/Owner] , ' ' AS [Securable] , ' ' AS [Grantee Type] , ' ' AS [Grantee] , ' ' AS [Permission] , ' ' AS [State] , ' ' AS [Grantor] , ' ' AS [Grantor Type] , ' ' AS [Source View] FROM tempdb.[STIG].[database_role_members] UNION SELECT DISTINCT 'DB SECURABLES' AS Type , ISNULL(drm.member, 'None') AS [Role/Securable/Class] , dp.[Securable Type or Class] COLLATE SQL_Latin1_General_CP1_CI_AS , dp.[Schema/Owner] , dp.Securable , dp.[Grantee Type] COLLATE SQL_Latin1_General_CP1_CI_AS , dp.Grantee , dp.Permission COLLATE SQL_Latin1_General_CP1_CI_AS , dp.State COLLATE SQL_Latin1_General_CP1_CI_AS , dp.Grantor , dp.[Grantor Type] COLLATE SQL_Latin1_General_CP1_CI_AS , dp.[Source View] FROM tempdb.[STIG].[database_role_members] drm LEFT JOIN tempdb.[STIG].[database_permissions] dp ON ( drm.member = dp.grantee OR drm.role = dp.grantee ) WHERE dp.Grantor IS NOT NULL AND [Schema/Owner] <> 'sys'
The text was updated successfully, but these errors were encountered: