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
Looks like we are getting a message that if a database is Contained then it can't have orphaned users. But if the user was mapped as a normal user to a login at the server level, then it can definitely be orphaned. Not all users in a Contained database have to be contained, it just gives them the option to be so.
WARNING: [10:24:16][Repair-DbaDbOrphanUser] Database '[blah]' is a contained database. Contained databases can't have orphaned users. Skipping validation.
To reproduce, create a login at the instance level using SSMS and go into User Mapping and add it as a user in a database. Then go delete the login at the instance level. You can see that the user still exists in the database and is now orphaned. If you then go recreate the login but don't map it to the user, then the user in the database is still orphaned. You can then run the cleanup to remap them.
My use case is that I was running the Copy-DbaLogin and then Copy-DbaDatabase and needed to cleanup any orphaned SQL Native logins that may now exist.
The text was updated successfully, but these errors were encountered:
Looks like we are getting a message that if a database is Contained then it can't have orphaned users. But if the user was mapped as a normal user to a login at the server level, then it can definitely be orphaned. Not all users in a Contained database have to be contained, it just gives them the option to be so.
WARNING: [10:24:16][Repair-DbaDbOrphanUser] Database '[blah]' is a contained database. Contained databases can't have orphaned users. Skipping validation.
To reproduce, create a login at the instance level using SSMS and go into User Mapping and add it as a user in a database. Then go delete the login at the instance level. You can see that the user still exists in the database and is now orphaned. If you then go recreate the login but don't map it to the user, then the user in the database is still orphaned. You can then run the cleanup to remap them.
My use case is that I was running the Copy-DbaLogin and then Copy-DbaDatabase and needed to cleanup any orphaned SQL Native logins that may now exist.
The text was updated successfully, but these errors were encountered: