sqldbawithabeard.com
Add User to SQL Server Database Role with PowerShell and Quickly Creating Test Users
There is a newer up to date version of this post here using the dbatools module and the sqlserver module But if you want to continue with this way read on!! Having created Windows Users or S…