2
I would like to find\create a command to list all user accounts with all details on a Windows Domain Controller (Server 2012 R2) from a specified group.
Using "net users" would be perfect, but I have no idea how to do output of this command for all users in one action (i.e. I need to write this command for each user separately if I want to get to know details).
If there is no way to use "Net users" then
WMIC USERACCOUNT
would be nice too. But I also need to get information from the specified group (Enterprise Admins, Domain Admins etc.).
I know that I can use PowerShell, but I'm trying to find a solution for CMD
.
Hm. Thanks! I will use PowerShell if i fail to find a solution for CMD. It seems Output is not very informative. Then i use "Net users" i gain a lot of information such as: Comment, Password last update, last logon, Global Group membership etc. I guess i have to change "Select Object name" to "Select" ? – Nick – 2018-11-03T23:38:16.500
Yep. "I would like to find\create a command to list all user accounts with all details" - mb my wording was not really good. – Nick – 2018-11-03T23:44:41.183
@Nick All that detail per account is....
Get-ADUser "<username>" -Properties *
from what I can tell with testing so you want to know the members of the group and then for each of those members you want all the detail from that command as well? – Pimp Juice IT – 2018-11-03T23:49:38.097@Nick I just updated my answer with more detail and a small example but that's how that works and it's not that difficult either. You can expand on that and get other properties and values, put in a different format if needed, etc. Help me understand more precise what values you need and I'll see if I can help further but this is the logic you could use and getting the rest is trivial from there. – Pimp Juice IT – 2018-11-04T00:20:40.337
@Nick Lastly, FYI in case you are interested... I've used commands such as
ldifde
,dsget group
, anddsquery group
for similar purposes in the past but PowerShell is way easier and more robust. Some of those commands get long and ugly and I don't recall if it gives all the detail you require. I too was looking for a cmd solution many years ago and that's what I dug up from an old set of scripts I used in the past.... PowerShell should be the way to go for Windows Domain Admin stuff with this task I think. You can still run it via batch or cmd.exe either way. Good luck regardless!! – Pimp Juice IT – 2018-11-04T00:32:19.190