使用wmic檢視遠端伺服器磁碟空間剩餘量

2021-10-08 07:06:12 字數 1030 閱讀 1229

1、準備工作

1.1、遠端伺服器的ip、主機賬號及密碼

確認遠端伺服器ip位址、主機賬號及密碼。

1.2、服務

確認開啟remote procedure call (rpc)、remote procedure call (rpc) locator服務

1.2、防火牆及埠

檢視遠端伺服器是否開啟防火牆,若開啟防火牆,則必須開通135埠

2、遠端查詢磁碟空間狀態

2.1、查詢遠端計算機磁碟狀態,本地輸出

wmic /node:」[ip]″ /user:」[username]」 /password:」[password]″  logicaldisk where "name='c:'" get deviceid,size,freespace,description,filesystem

如:wmic /node:」192.168.5.20″ /user:」administrator」 /password:」123456789″  logicaldisk where "name='c:'" get deviceid,size,freespace,description,filesystem

2.2、查詢遠端計算機磁碟狀態,輸出到指定檔案

wmic /node:"[ip]" /user:"[username]" /password:"[password]" /output:[outputfilename] logicaldisk where "name='[disk]'" get deviceid,size,freespace,description,filesystem /format:htable

如:wmic /node:"192.168.5.20" /user:"administrator" /password:"123456789" /output:outputly.html logicaldisk where "name='c:'" get deviceid,size,freespace,description,filesystem /format:htable

3、使用wmic查詢本地計算機磁碟空間使用情況:

Python 檢視伺服器磁碟資訊

檢視磁碟資訊,主要用到了兩個方法 使用方法 1 安裝 psutil pip install psutil 2 進入 python shell,並 import psutil 輸入 help psutil.disk partitions 返回 help on function disk partiti...

Linux使用nfs對映遠端伺服器磁碟目錄

需要對映的機器為172.23.142.186,對映目錄為 home data 1 分別在兩台機器中安裝nfs rpcbind yum install nfs utils rpcbind 2 在172.23.142.158上修改 etc exports檔案,新增如下內容 data 172.23.142...

檢視伺服器磁碟 檔案的aspx

listdrives.aspx page language c import namespace system import namespace system.io string qdrives environment.osversion.tostring string qnewline envir...