I am using PowerShell cmdlet Get-SPUser
through C# program remotely as follows
Get-SPUSer -Web <siteCollection> | Select-Object -property Name,LoginName....
After I invoke this command it gives me output in form of Collection<PSObject>
This command is taking 13 minutes for fetching just 1000 users. Isn't it too long? This is when I fired it remotely and via C# program.
When I trigger the same command using PowerShell command prompt, it returns within a few seconds.
Why it is taking so long time when fired remotely via C# program?
I am using .NET framework is 4.0 and Visual Studio 2013. Same results with .NET framework 2.0/3.5 and Visual Studio 2005.
Any clue or workaround how to improve performance of select-object
cmdlet?
Can anybody give a concrete solution?