To get a list of all users of a SharePoint web application in PowerShell, we can use get-spuser cmdlet. This cmdlet should be used with SPWeb object.
To get all users in a web application use this PowerShell command. It will include all users in all site collections of web application.
Get-SPWebApplication http://sp2010:2000 | Get-SPSite | Get-SPWeb | Get-SPUser
UserLogin DisplayName
--------- -----------
DS\expsah DS\expsah
SHAREPOINT\system System Account
DS\expsah DS\expsah
NT AUTHORITY\auth... NT AUTHORITY\auth
NT AUTHORITY\LOCA... Salman Mn1 Ahmad
SHAREPOINT\system System Account
DS\expsah DS\expsah
NT AUTHORITY\auth... NT AUTHORITY\auth
NT AUTHORITY\LOCA... Salman Mn1 Ahmad
SHAREPOINT\system System Account
DS\expsah DS\expsah
NT AUTHORITY\auth... NT AUTHORITY\auth
NT AUTHORITY\LOCA... Salman Mn1 Ahmad
SHAREPOINT\system System Account