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
No error, but this doesn't feel like intended behaviour. If I want to get all users for a particular login, Get takes minutes. If I want to export the scripts to create them as well as their extra permissions, Export takes seconds. Logically, Export ought to require getting each user, so this mismatch in runtimes seems very strange.
Steps to Reproduce
Just run both for a particular login on one of your boxes. No special parameters or steps needed. Don't specify a database. It might be worth mentioning that my instances all have around 50 databases.
Please confirm that you are running the most recent version of dbatools
Yes.
Other details or mentions
No response
What PowerShell host was used when producing this error
Windows PowerShell (powershell.exe)
PowerShell Host Version
5.1.19041.4648
SQL Server Edition and Build number
I hit multiple, but mostly 2019.
.NET Framework Version
Very recent.
The text was updated successfully, but these errors were encountered:
At first sight I think the "try Connect-DbaInstance " is the culprit. I've found this in multiple commands.
It makes functions incompatible with Azure while those otherwise could work fine, and I believe it makes them slower as well.
A general approach to make embedded Connect attempts faster and avoid redundant connections will be preferred.
(for Get-DbaDbUser in particular, other adjustments may also be beneficial, but I believe those to be of minor influence)
I guess here the point is that with 50 databases, targeting just one db, the raw query Get-DbaDatabase to prefilter dbs does is simply faster than SMO enumeration.
If you try to clock Get-DbaUser vs Export-DbaUser NOT targeting a specific db, Get-DbaUser is actually a lot faster.
Verified issue does not already exist?
I have searched and found no existing issue
What error did you receive?
No error, but this doesn't feel like intended behaviour. If I want to get all users for a particular login,
Get
takes minutes. If I want to export the scripts to create them as well as their extra permissions,Export
takes seconds. Logically,Export
ought to require getting each user, so this mismatch in runtimes seems very strange.Steps to Reproduce
Just run both for a particular login on one of your boxes. No special parameters or steps needed. Don't specify a database. It might be worth mentioning that my instances all have around 50 databases.
Please confirm that you are running the most recent version of dbatools
Yes.
Other details or mentions
No response
What PowerShell host was used when producing this error
Windows PowerShell (powershell.exe)
PowerShell Host Version
5.1.19041.4648
SQL Server Edition and Build number
I hit multiple, but mostly 2019.
.NET Framework Version
Very recent.
The text was updated successfully, but these errors were encountered: