After I removed an AD Group from the general security area, it's still mapped to about 18 Databases (This is a QA box) how can I get rid of all the account without having to go through each DB one by one?
1 Answer
You can script it out similar to this:
EXEC sp_Msforeachdb "IF EXISTS (SELECT * FROM sys.database_principals WHERE name = N'USERNAME') DROP USER [USERNAME]"
GO
I've only used it for individual users, not for groups, but it should work.