Windows 7/10 Administration Commands

The following are commands I use often when administering Windows 7 and Windows 10 computers in both domain (Active Directory) and non-domain (Workgroups) setups.

Executing Remote Commands (Requires SysInternals)

SysInternals: https://docs.microsoft.com/en-us/sysinternals/downloads/sysinternals-suite

PsExec \\<computername> <command(s)>

Start Remote cmd Session (uses Sysinternals psexec.exe)

PS C:\> psexec \\<computer name> cmd

Start Remote Powershell

PS C:\> Enter-PSSession -ComputerName <computer name>

List Installed Printers

wmic printer list brief
PS C:\> Get-WmiObject -Class Win32_Printer

Get OS

wmic os get Caption,CSDVersion /value
or with systeminfo
systeminfo | findstr /B /C:"OS Name" /C:"OS Version"

Get System Architecture

wmic OS get OSArchitecture

Find Installed RAM

PS C:\> wmic memorychip get capacity Capacity 4294967296 4294967296

Or with systeminfo

PS C:\> systeminfo | findstr /C:"Total Physical Memory" Total Physical Memory: 8,100 MB

Memory Details

wmic memorychip list full

List Installed Programs

wmic product get name
wmic product list brief

Rename printer

cscript C:\Windows\System32\Printing_Admin_Scripts\en-US\prncnfg.vbs -x -p <current Printer name> -z <New Printer Name>

Get running processes

PS C:\> get-process
PS C:\> gps

List, add, and remove users from a local group

In this example, the local group will be administrators.

Net localgroup administrators
Net localgroup administrators /add domain\user.name
Net localgroup administrators /delete domain\user.name

Leave a Reply

Your email address will not be published. Required fields are marked *