中国网络-ITPro俱乐部's Archiver

跃跃领舞 发表于 2007-7-5 17:37

转载:从远程计算机卸载SMS 高级客户端脚本

该贴转自合作社区——[url=http://www.systemcenter.com.cn/bbs/]SC中文社区[/url],请大家支持国内最专业的SystemCenter中文社区!

这个脚本可以在提示你输入远程计算机名称之后帮助你完成SMS高级客户端卸载工作, 脚本有效性根据自己环境实际情况进行调整。
VBS Script:

strComputer = InputBox("Enter Machine Name")
strApplicati

Set wshShell = WScript.CreateObject("WScript.Shell")
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colSoftware = objWMIService.ExecQuery ("Select * From Win32_Product where Name = '" & strApplicationName & "'")
For Each objSoftware in colSoftware

If objSoftware.Name = strApplicationName Then
ApplicationFound = True
MsgBox "Removing The " & strApplicationName & " From " & UCase(strComputer)
objSoftware.Uninstall()
MsgBox "Done"
End If
Next

If ApplicationFound <> True Then
MsgBox strApplicationName & " Is Not Installed On " & UCase(strComputer)
End If

Note: These folders and files may still exist and can be removed:

%WinDir%\System32\Ccm
%WinDir%\System32\Ccm\Inventory
%WinDir%\System32\Ccm\Inventory\SkpSwi.Dat
%WinDir%\System32\Ccm\Logs\SmsCliUi.Log

页: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.