Tuesday, May 31, 2016

Do I have the Right?


So many times, I needed to see what groups I'm in, who else is in a group, or get a list of Domain groups.

This is trivial from the command line.

NET USER - NET USER does the following

  • Retrieve a list of users on the machine from which you execute the command.
  • Retrieve a list of users from the domain
  • Retrieve the user's account information for a local account
  • Retrieve the user's account information for a domain account

Syntax

  • NET USER - Retrieve local user list
  • NET USER  /DOMAIN - Retrieve domain user list
  • NET USER UserName - Retrieve local user account 
  • NET USER UserName  /DOMAIN - Retrieve domain user account 

NET GROUP, NET GROUPS, NET LOCALGROUP- NET GROUP series of commands does the following.  Note:  NET GROUP and NET LOCALGROUP (singular) get information for a single group while NET GROUPS and NET LOCALGROUPS (plural) gets information about the groups that exist.
  • Retrieve a list of groups on the machine from which you execute the command.
  • Retrieve a list of groups from the domain
  • Retrieve the list of users that belong to a specific group on the local machine
  • Retrieve the list of users that belong to a specific group on the domain 
Syntax
  • NET LOCALGROUPS
  • NET GROUPS /DOMAIN
  • NET LOCALGROUP "group name"
  • NET GROUP "Group Name" /DOMAIN


Find the Computer's Make, Model and Serial Numbers

My Boy Benny
So we have a database of all servers, databases, applications, service accounts and such.  I had to make sure all of our servers are in the database correctly.

When I have only the computer name, but no information, I can find a great deal of info by getting in the command line after reporting in and using some handy commands.

Get computer make model and type
 - wmic computersystem get model,name,manufacturer,systemtype

Get serial number
- wmic bios get serialnumber