dbatools icon indicating copy to clipboard operation
dbatools copied to clipboard

Export-DbaUser is much faster than Get-DbaUser, even though it does less work.

Open ReeceGoding opened this issue 1 year ago • 0 comments

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.

ReeceGoding avatar Aug 21 '24 12:08 ReeceGoding