Tuesday, October 23, 2012

Use WMIC to get logged in user from remote computer

The Command:

C:\>WMIC /NODE:’Hostname' ComputerSystem Get Username,Name

The Results:

Name           UserName

Hostname  Domain\User.Name

 

The node can be the DNS name, or IP Address, also a list can be used as well.

I would have really liked to use this command to query thousands of nodes, however through experimentation the tool seemed to crash after 30 or 40 hosts.

I tried the /FAILFAST:ON and /FAILFAST:50 options with some improvements, but nothing solid.

Please comment if you have used this tool successfully for a large list of nodes.

Thanks!

 

2 comments:

  1. I ended up using PSTools (PSLoggedOn) to collect the usernames instead of WMIC.

    ReplyDelete