Skip to content

Question to command Add-DbaDbRoleMember #7666

Answered by stj-fr
stj-fr asked this question in Q&A
Discussion options

You must be logged in to vote

Hello,
I've found it my fault, I have to issue first this command to map the user to the database:

New-DbaDbUser -SqlInstance SERVER -Database mydb -Username sqluser -Login sqluser

ComputerName       : SERVER
InstanceName       : MSSQLSERVER
SqlInstance        : SERVER
Database           : MYDB
CreateDate         : 02.08.2021 11:48:05
DateLastModified   : 02.08.2021 11:48:05
Name               : sqluser
Login              : sqluser
LoginType          : SqlLogin
AuthenticationType : Instance
State              : Existing
HasDbAccess        : True
DefaultSchema      : dbo

And than Add-DbaDBRoleMember works....

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@andreasjordan
Comment options

Answer selected by stj-fr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants