T
T
Thomas Andersen2014-09-11 15:09:16
Microsoft
Thomas Andersen, 2014-09-11 15:09:16

How to display only users with the query user command in windows?

Or query session, tell me how to filter with find or findstr ?
Or is it better to do it somehow via PowerShell?
What filters? any option please?
PS I would like users to simply display in the column:
user1
user2
user3
user4
user5
That is, only the first column Username is needed, here's how to filter the column is a snag for me ..(

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrew, 2014-09-11
@OLS

FOR /F "tokens=1 skip=1" %%A IN ('query session') DO @echo %%A

G
GRayFist, 2014-11-27
@GRayFist

Try Powershell

Import-Module ActiveDirectory # Импортируете модуль для работы с AD
Get-ADUser -Filter {Enabled -eq $True} | Select Name

The script will output the Name parameter for all active users.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question