Forum Discussion
Byking23
Nov 25, 2019Copper Contributor
NEED TO GET ALL USER ACCOUNTS ON MY NETWORK/DOMAIN WITH A SCRIPT
Good day Colleagues,
Hope y'all doing well!
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.
Thanks in advance
These ones may help.
There are many scripts here you may be able to modify to suit your needs.
https://gallery.technet.microsoft.com/scriptcenter/
or request a script to be written here.
https://gallery.technet.microsoft.com/scriptcenter/site/requests
or ask for more help with writing a script here.
https://social.technet.microsoft.com/Forums/windowsserver/en-US/home?forum=winserverpowershell
https://social.technet.microsoft.com/Forums/en-US/home?forum=ITCG
(please don't forget to mark helpful replies as answer)