Coming for a help here because recently i need to get from my mainserver all user accounts active and inactive (True/False) that i have on my network using PowerShell. The point is to gather all them and create a file where i have them all organized.
i've been trying to do it using the following scritp but haven't been sucessful:
Get-LocalUser | Out-File c:\$env:username.txt
Please let me know if y'all have a solution for it.