Windows General Administration Tips for day to day task. These are commands I use in day to day operation to get quick info and control our domain users. Most of commands may work in domain environment, but you can modify it to work with work-group environment if you know the remote PC id password.
Also I am using PSTOOLS to accompany the tasks. You should download pstools and extract them in c:\pstools folder.
Most of pstools commands require remote registry on remote PC must be running. you can start that service on remote PC by using following command.
TIP: When the Utilities Won’t Connect Because of Remote Registry
psservice \\remotepc start RemoteRegistry
To get detail report for remote PC [I assume you are admin of the domain]
systeminfo /s remote_computer_name
C:\pstools>systeminfo /s ZAIBPC Host Name: ZAIBPC OS Name: Microsoft Windows 7 Professional OS Version: 6.1.7601 Service Pack 1 Build 7601 OS Manufacturer: Microsoft Corporation OS Configuration: Member Workstation OS Build Type: Multiprocessor Free Registered Owner: xxxx Registered Organization: Product ID: xxxx-005-4355353-xxxxx Original Install Date: 05/10/2017, 7:34:19 AM System Boot Time: 02/21/2020, 10:37:35 AM System Manufacturer: HP System Model: HP ProBook 450 G4 System Type: x64-based PC Processor(s): 1 Processor(s) Installed. [01]: Intel64 Family 6 Model 142 Stepping 9 GenuineIntel ~1080 Mhz BIOS Version: HP P85 Ver. 01.03, 12/05/2016 Windows Directory: C:\Windows System Directory: C:\Windows\system32 Boot Device: \Device\HarddiskVolume1 System Locale: en-us;English (United States) Input Locale: en-us;English (United States) Time Zone: (UTC+05:00) Islamabad, Karachi Total Physical Memory: 8,089 MB Available Physical Memory: 4,781 MB Virtual Memory: Max Size: 16,177 MB Virtual Memory: Available: 12,869 MB Virtual Memory: In Use: 3,308 MB Page File Location(s): C:\pagefile.sys Domain: agp1 Logon Server: N/A Hotfix(s): 156 Hotfix(s) Installed. [01]: KB2849697 xxxxxxxxxxx Network Card(s): 4 NIC(s) Installed. [01]: Realtek PCIe GBE Family Controller Connection Name: Local Area Connection Status: Media disconnected [02]: Realtek RTL8723BE 802.11 bgn Wi-Fi Adapter Connection Name: Wireless Network Connection DHCP Enabled: Yes DHCP Server: xx.xx.xx.xx IP address(es) [01]: 101.11.16.179 [02]: fe80::1dfb:77a7:d4b8:d0e6 [03]: Microsoft Virtual WiFi Miniport Adapter Connection Name: Wireless Network Connection 2 Status: Media disconnected [04]: Bluetooth Device (Personal Area Network) Connection Name: Bluetooth Network Connection Status: Media disconnected Hyper-V Requirements: VM Monitor Mode Extensions: No Virtualization Enabled In Firmware: No Second Level Address Translation: No Data Execution Prevention Available: Yes
Inquire Remote PC Hardware Info like Board / serial and OS Architecture 32bit/64bit.
– To get Board number of local pc
wmic baseboard get product,Manufacturer,version,serialnumber
– To get Board number of remote pc
wmic /node:"remotepc" baseboard get product,Manufacturer,version,serialnumber
– To get remote PC Architecture like 32bit or 64bit
wmic /node:"remotepc" os get osarchitecture
PSTOOLS RELATED
# PSLOGGEDON COMMANDS
To check which user is logged on remote PC,
psloggedon \\remotepc
# PSEXEC COMMANDS
– To execute any command on remote PC like
psexec \\remtotepc ipconfig
– To open COMMAND prompt of remote user
psexec \\remotepc cmd
-Interacting with the Logged On User on the Remote PC
psexec \\remotepc -d -i notepad
# PSINFO COMMANDS
Getting general info of OS, uptime etc with disk info as well
psinfo -d \\remotepc
# PSLIST COMMANDS
To get running process list from remote PC.
pslist \\remotepc
# PSKILL COMMANDS
– Kill any running program on remote PC.
pskill \\remotepc notepad
# PSSHUTDOWN COMMANDS
– To shutdown remote PC
psshutdown \\remotepc -d
# WINDOWS BUILTIN SHUTDOWN TOOL
Its recommended to use windows builtin shutdown utility/tool
– To Shutdown local PC in 30 seconds with popup message.
shutdown /s /t 30 /c "Shutdown by Admin"
– To restart Local PC in 30 seconds
shutdown /r /t 30 /c "Restart by Admin"
– To shutdown REMOTE PC in 30 seconds with a message
shutdown /m \\remotepc /s /t 30 /c "Shutdown by Admin"
– To restart REMOTE PC in 30 seconds
shutdown /m \\remotepc /r /t 30 /c "Shutdown by Admin"
# WINDOWS TASK LIST / KILL TOOLS
# WINDOWS BUILTIN TASK LIST TOOL (to view remote pc running process task)
tasklist /S REMOTEPC
– To kill remote PC task by name
taskkill /S REMOTEPCNAME /F /IM notepad.exe
# WINDOWS BUILTIN TASKKILL TOOL (to kill any task)
– to kill local task by name with force
taskkill /IM /F notepad.exe
– to kill local running task by PID
taskkill /PID 1234 /T
More will be added later.
Some more reference for using PSTOOLS in some automated ways are
https://aacable.wordpress.com/tag/howto-install-snmp-in-windows-7-remotely/
Regard’s
Syed Jahanzaib