How can I output all the output of a called command in Powershell script
问题 I have adapted an existing Powershell script to query a list of servers for logged in (or disconnected) user sessions using quser /server:{servername} and output the results into a CSV file. It does output any logged in users but what it doesn't capture is servers that had 0 users or weren't accessible (server offline, rpc not available, etc.). I'm assuming that is because these other conditions are "errors" rather than command output. So if it hits a server with no users it outputs "No User