You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Example #4 for New-DbaDbUser is incorrect. It states: Get-DbaDbUser -SqlInstance sqlserver1 -Database DB1 | New-DbaDbUser -SqlInstance sqlserver2 -Database DB1
When I attempt to execute similar code, I get "The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties do not match any of the parameters that take pipeline input."
Which makes sense because none of the params for New-DbaDbUser accept pipeline input.
It would be nice if it did in fact accept pipeline input so we could copy one or more users from one DB to another. In the short term, removing the example from the docs would be sufficient.
I disagree here. Allowing multiple object types piped in makes the commands complex and may introduce a lot of bugs.
A New-Dba* command should at maximum allow pipeline input from the object one level above in the SMO hierarchy, so New-DbaDbUser should only allow pipeline input from Get-DbaDatabase.
I will correct the documentation and remove the wrong example, then closing this issue.
If someone wants the functionality of the mentioned example, I see this as a feature request and the solution should be a Copy-DbaDbUser command.
We may want to add pipeline input support to this command, but I would see this as well as a (low priority) feature request.
Example #4 for New-DbaDbUser is incorrect. It states:
Get-DbaDbUser -SqlInstance sqlserver1 -Database DB1 | New-DbaDbUser -SqlInstance sqlserver2 -Database DB1
When I attempt to execute similar code, I get "The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties do not match any of the parameters that take pipeline input."
Which makes sense because none of the params for
New-DbaDbUser
accept pipeline input.It would be nice if it did in fact accept pipeline input so we could copy one or more users from one DB to another. In the short term, removing the example from the docs would be sufficient.
https://github.com/sqlcollaborative/dbatools/blob/master/functions/New-DbaDbUser.ps1
The text was updated successfully, but these errors were encountered: