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?

  • If you do it using a c# program, why don´t you use the c# Client-API? Do you use a remote-powershell? Commented Jun 30, 2015 at 6:55
  • @Leopold - Client API does not provide all properties of sharepoint user ! Yes I do use powershell remotely. PowerShell command users Server API internally so that is why I get all properties of user. I don't want to use Server API as I have requirement to connect sharepoint server remotely.
    – BND
    Commented Jun 30, 2015 at 7:01

1 Answer 1


You could add your own webservice to sharepoint. You could call that service remote and process the response.

But you might not have a chance to speed up the powershell-remoting-process. this does not belong to sharepoint itself.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.