Administration is not my forte, so you shouldn't take my advice as the only truth.
But you can use something like this.
declare @cmd1 varchar(500),
@cmd2 varchar(500)
set @cmd1 =
'use ?; if ''?'' NOT IN( ''tempdb'', ''Master'', ''Model'', ''msdb'') print ''CREATE USER MyGroup FOR LOGIN Mydomain\MyGroup'''
set @cmd2 =
'use ?; if ''?'' NOT IN( ''tempdb'', ''Master'', ''Model'', ''msdb'') print ''EXEC sp_addrolemember ''''db_owner'''', ''''MyGroup'''''''
exec sp_MSforeachdb @command1=@cmd1, @command2=@cmd2
This code won't do anything, it will just print a script. You could modify it to make it work, but you should test a part of it first.