admin 管理员组

文章数量: 887021

通过wmic监控Windows系统信息

    • 1、wmic 格式化输出
    • 2、获取服务器信息
    • 3、获取系统信息
    • 4、获取硬盘信息
    • 5、获取磁盘剩余空间
    • 6、获取文件共享
    • 7、获取网络共享信息
    • 8、获取CPU信息
    • 9、获取内存硬件信息
    • 10、获取内存使用信息
    • 11、获取域控信息
    • 12、获取进程信息

1、wmic 格式化输出

wmic ALIAS get property,property /format:CSV

2、获取服务器信息

wmic baseboard get manufacturer,product
Manufacturer  Product
LENOVO        GA-6UASV2

3、获取系统信息

wmic computersystem get caption,dnshostname,model,systemtype
Caption      DNSHostName  Model                     SystemType
FILESERVER4  fileserver4  Lenovo ThinkServer TS530  x64-based PC

4、获取硬盘信息

wmic diskdrive get caption, size,status
Caption                                             Size            Status
WD5003ABYX-88                       LEN ATA Device  500105249280    OK
WD5003ABYX-88                       LEN ATA Device  500105249280    OK
HPT DISK 0_0 SCSI Disk Device                       42007056053760  OK
iCloud OmniCOS SCSI Disk Device                     10995110138880  OK

5、获取磁盘剩余空间

wmic volume get Caption,drivetype,filesystem,freespace
Caption  DriveType  FileSystem  FreeSpace
C:\      3          NTFS        76948217856
G:\      3          NTFS        97201881088
F:\      3          NTFS        7987740704768
Z:\      3          NTFS        10860216836096
D:\      3          NTFS        288163233792
H:\      3          NTFS        288333963264

6、获取文件共享

wmic share get Caption,name,path,status | find /V  "$"
Caption     Name        Path           Status
Backup      Backup      F:\Backup      OK
IPCMPT      IPCMPT      F:\IPCMPT      OK
IPVFX       IPVFX       F:\IPVFX       OK
Monitor     Monitor     G:\Monitor     OK
Project     Project     F:\Project     OK
render      render      F:\render      OK
SoftRepo    SoftRepo    Z:\SoftRepo    OK
tmp         tmp         F:\tmp         OK
USB_Backup  USB_Backup  F:\USB_Backup  OK

7、获取网络共享信息

wmic netuse get localname,name,remotename,remotepath,status,username
LocalName  Name                       RemoteName            RemotePath            Status  UserName
P:         \\172.21.1.5\project (P:)  \\172.21.1.5\project  \\172.21.1.5\project  OK      IP\Administrator

8、获取CPU信息

wmic cpu get Caption,loadpercentage
Caption                               LoadPercentage
Intel64 Family 6 Model 58 Stepping 9  1

9、获取内存硬件信息

wmic memorychip get caption,banklabel,capacity,manufacturer,speed
BankLabel  Capacity    Caption          Manufacturer   Speed
BANK 0     4294967296  Physical Memory  Hynix/Hyundai  1333
BANK 1     4294967296  Physical Memory  Hynix/Hyundai  1333
BANK 3     4294967296  Physical Memory  Hynix/Hyundai  1333

10、获取内存使用信息

wmic os get freephysicalmemory,totalvisiblememorysize
FreePhysicalMemory  TotalVisibleMemorySize
8452988             12550120

11、获取域控信息

wmic ntdomain get caption,dnsforestname,domaincontrolleraddress,domaincontrollername,status
Caption  DnsForestName  DomainControllerAddress  DomainControllerName  Status
IP       ip          \\172.21.1.8             \\IPAD                OK

12、获取进程信息

wmic process  get caption,commandline
mmc.exe                                    "C:\Windows\system32\mmc.exe" "C:\Windows\system32\taskschd.msc" /s
mmc.exe                                    "C:\Windows\system32\mmc.exe" "C:\Windows\system32\ServerManager.msc"
TrustedInstaller.exe                       C:\Windows\servicing\TrustedInstaller.exe
.......

本文标签: 系统 信息 wmic Windows