search
Categories
Sponsors
VirtualMetric Hyper-V Monitoring, Hyper-V Reporting
Archive
Blogroll

Badges
MCSE
Community

Cozumpark Bilisim Portali
Posted in Windows Powershell, Windows Server | No Comment | 1,931 views | 09/07/2013 10:05

As you may know, if you have SCCM 2007 agent on your Windows Server 2012, then you may see some problems with WMI. That issue blocks all WMI communication, Remote Desktop Services and Cluster functionality.

Recommended way to upgrade your SCCM 2007 to SCCM 2012, or you need to apply latest patches to your SCCM server.

You can disable all agents like this:

1
2
3
4
5
6
7
8
9
$Servers = Get-Content C:\Servers.txt
foreach ($Server in $Servers)
{
	Write-Host $Server
	(Get-WmiObject win32_process -Filter "name = 'CcmExec.exe'" -ComputerName $Server).Terminate()
	Set-Service -ComputerName $Server -Name "CcmExec" -StartupType "Disabled"
	Set-Service -ComputerName $Server -Name "smstsmgr" -StartupType "Disabled"
	Start-Sleep 1
}

After that, service will stopped and startup type will be disabled to avoid automatic startup after reboot.