IT人員如果要在自己的位置上uninstall remote PC的軟體或要看遠端電腦安裝什麼軟體得話大多數的人應該是利用遠端桌面,用管理者登入去移除軟體吧?!
如此做,沒有什麼不好,但是需要使用者暫停作業,有時候會不方便。
利用內建的WMIC其實就可以做到不錯效果。
- IT需要有管理者的角色
- 如果HOST Name中有【-】或【/】等符號,需用""括起來
- 在DOS window中keyin 【wmic】
- 輸入您要控制的電腦【/node:"586-test"】
- 如果要看其安裝了什麼軟體可下【product】指令
- product會list很多資料,所以您也可以這樣做
【/node:ANOTHEREXAMPLE product where vendor="Apple Inc." get name,vendor】 - 也可用通用字元【/node:ComputerXYZ product where "vendor like 'adobe%'" get name,version,identifyingNumber】
- uninstall software
- /node:EXAMPLE product where name="Java(TM) 6 Update 7" call uninstall
接下來會問是否要移除:Execute (\\586-test\ROOT\CIMV2:Win32_Product.IdentifyingNumber="{3248F0A8-6813-11D6-A77B-00B0D0160070}",Name="Java(TM) 6 Update 7",Version="1.6.0.70")->Uninstall() (Y/N/?)?,請輸入y即可 - 如果不要有互動可加參數【/nointeractive】ex:/nointeractive flag like /node:EXAMPLE product where name="MobileMe Control Panel" call uninstall /nointeractive
- 如果有一堆電腦要反安裝得話Call Uninstall for a List of Machines
您可將computer's names stored in c:\computers.txt,下指令>/fastfail:on /node:@"c:\computers.txt" product where name="Acrobat.com" call uninstall /nointeractive
參數fastfail:on其作用為可快速的跳過沒有反應(開機)的電腦 - 如果想直接run得話,可下指令:
wmic /fastfail:on /node:@"FILENAME.txt" product where "name like 'microsoft office professional edition 2003'" call uninstall /nointeractive
http://community.spiceworks.com/how_to/show/179
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/wmic_overview.mspx?mfr=true
ex:
product where "vendor like 'sun%'" get name,version
product where "vendor like 'sun%'" call uninstall /nointeractive
wmic /output:"C:\Export.txt" /node:workstation product
process where name='notepad.exe' call terminate
WMIC /locale:ms_409 OS WMIC OS LIST BRIEF WMIC OS GET csname, locale, bootdevice WMIC /locale:ms_409 NTEVENT where LogFile='system' WMIC NTEVENT where "LogFile='system' and Type>'0'" WMIC SERVICE where (state=”running”) GET caption, name, state > services.tsv WMIC SERVICE where caption='TELNET' CALL STARTSERVICE WMIC PRINTER LIST STATUS WMIC PRINTER where PortName="LPT1:" GET PortName, Name, ShareName WMIC /INTERACTIVE:ON PRINTER where PortName="LPT1:" DELETE WMIC PROCESS where name='evil.exe' delete WMIC /output:"%computername%.txt" MEMORYCHIP where "memorytype=17" get Capacity WMIC /node:@workstns.txt /failfast:on PROCESS call create "\\server\share\installer.cmd"
沒有留言:
張貼留言