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
I found that Get-DbaDbRoleMember is "unrolling" nested role memberships. For example if UserA is a member of Role1, and Role1 is a member of Role2, then Get-DbaDbRoleMember will return both an object for User1 in Role1 and an object for User1 in Role2.
I'm trying to use this command as part of a script to copy over select users between databases, and ensure that role assignments are exactly matched (a requirement for a 3rd-party application utility that performs an app upgrade and data migration). Since the nested role memberships are being unrolled, using the output from Get-DbaDbRoleMemberships from the source database to drive Add-DbaDbRoleMember on the target results in extra explicit role memberships.
Is this unrolling behavior intended? If so, I'm open to suggestions on how to get database users' explicit role memberships.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I found that Get-DbaDbRoleMember is "unrolling" nested role memberships. For example if UserA is a member of Role1, and Role1 is a member of Role2, then Get-DbaDbRoleMember will return both an object for User1 in Role1 and an object for User1 in Role2.
I'm trying to use this command as part of a script to copy over select users between databases, and ensure that role assignments are exactly matched (a requirement for a 3rd-party application utility that performs an app upgrade and data migration). Since the nested role memberships are being unrolled, using the output from Get-DbaDbRoleMemberships from the source database to drive Add-DbaDbRoleMember on the target results in extra explicit role memberships.
Is this unrolling behavior intended? If so, I'm open to suggestions on how to get database users' explicit role memberships.
Beta Was this translation helpful? Give feedback.
All reactions