I've made a script in Powershell 2.0 for creating users in Microsoft SQL Server 2008.
Now, everything is fine. But I want to script 'user mapping' for new created logins.
So you know, if you choose properties of sql user and choose 'User Mapping' and select a database to map for the selected user.
I searched on Google, but doesn't find anything.. Can someone help me for powershell 2.0?