Archive for the ‘SCCM’ Category

 

The client log files for different CM components are located in the %WINDIR%\System32\CCM\Logs folder (x86) or  in %WINDIR%\SysWOW64\CCM\Logs ( x64 OS).

 

The config manager server log files are located in the C:\Program Files (x86)\Microsoft Configuration Manager\Logs or SMS_CCM\Logs folder , these are handy to see what’s happening when trouble shooting pxe deployment issues or to view other logs. I use CM trace or SMS trace to make viewing logs easier.

 

For servers the IIS logs can be found in %WINDIR%\System32\logfiles\W3SVC1

Repair SCCM client remotely

Posted: October 2, 2014 in SCCM, Scripts

 

Description:

This is a basic vbscript called by windows cscript to repair config manager clients. CM Clients can become broken for a number of reasons in enterprise environments. The  script has been tested on 2007 and should work on 2012 too. This script can be easily modified to retrieve hosts from a text file e.g computers.txt if you’re targeting a number of broken clients.

 Usage:

E.g  cscript scriptname.vbs computername

 

'Repair SCCM Client
'------------------------------------------------------------

Option Explicit
On Error Resume Next

Dim sComputer, sSCCMClient

If WScript.Arguments.Count = 0 Then
sComputer = InputBox("Enter computer name to repair")
Else
sComputer = WScript.Arguments(0)
End If

Set sSCCMClient = GetObject("winmgmts://" & sComputer & "/Root/Ccm:SMS_Client")

If Err <> 0 Then
MsgBox "Error:" & "(" & Err.Number & ")" & vbCrLf & Err.Description
Else
sSCCMClient.RepairClient
MsgBox ("Repair started for " & UCase(sComputer))
End If

WScript.Quit

Client ConfigMgr console Properties

%windir%\System32\CCM\SMSCliUI.exe
%windir%\SysWOW64\CCM\SMSCliUI.exe

Run Advertised Program (x64 & x86)

%windir%\System32\CCM\SMSRAP.CPL
%windir%\SysWOW64\CCM\SMSRAP.CPL

Task Sequence Progress Bar (x64 & x86)

%windir%\System32\CCM\TsProgressUI.exe
%windir%\SysWOW64\CCM\TsProgressUI.exe

SMS Agent Host Restart (x64 & x86)

%windir%\System32\CCM\CcmRestart.exe
%windir%\SysWOW64\CCM\CcmRestart.exe

SCCM (ConfigMgr) Client Repair – Command Line/ VB script / Powershell

%windir%\System32\CCM\ccmrepair.exe
%windir%\SysWOW64\CCM\ccmrepair.exe

—-policy.vbs—————-

On Error Resume Next
Dim oCPAppletMgr
Set oCPAppletMgr = CreateObject(“CPApplet.CPAppletMgr”)
Dim oClientActions
Set oClientActions = oCPAppletMgr.GetClientActions()
Dim oClientAction
For Each oClientAction In oClientActions
If oClientAction.Name = “Request & Evaluate Machine Policy” Then oClientAction.PerformAction
End If
Next
———————————————–
Powershell:

————-
Code Snippet

function repairclient([String] $strComputer)
{
$SMSCli = [wmiclass] “\\$strComputer\root\ccm:sms_client
$SMSCli.RepairClient()
}
———————————————–

 

SCCM Command line actions

WMIC is a great tool used to manage wmi from the command line, its been around a while and has been part of windows OS’s since XP. Its handy for a heap of things to manage workstations and retrieve data from systems and the bios.

Combine the power of psexec @ computers.txt list at target endpoints that have disabled or corrupted software distribution agents, and you will be on your way to fixing broken agents and deploying required software.

 

Disable Software-Distribution:
WMIC /namespace:\\root\ccm\policy\machine\requestedconfig path ccm_SoftwareDistributionClientConfig CREATE ComponentName=”Disable SWDist”,Enabled=”false”,LockSettings=”TRUE”,PolicySource=”local”,PolicyVersion=”1.0″ ,SiteSettingsKey

Re-Activate Software-Distribution:

WMIC /namespace:\\root\ccm\policy\machine\requestedconfig path ccm_SoftwareDistributionClientConfig WHERE ComponentName=”Disable SWDist” delete /NOINTERACTIVE

 

Trigger Hardware Inventory:

WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule “{00000000-0000-0000-0000-000000000001}” /NOINTERACTIVE

Trigger Software Inventory

:
WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule “{00000000-0000-0000-0000-000000000002}” /NOINTERACTIVE

Trigger DataDiscoverRecord (DDR) update:
WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule “{00000000-0000-0000-0000-000000000003}” /NOINTERACTIVE

Force a FULL HW Inventory on next HW-Inv Schedule:

WMIC /namespace:\\root\ccm\invagt path inventoryActionStatus where InventoryActionID=”{00000000-0000-0000-0000-000000000001}” DELETE /NOINTERACTIVE

Repair SMS/SCCM Agent on a remote client:
WMIC /node:%MACHINE% /namespace:\\root\ccm path sms_client CALL RepairClient

Repair a list (all clients listed in clients.txt) of remote SMS/SCCM Agents

:
WMIC /node:@clients.txt /namespace:\\root\ccm path sms_client CALL RepairClient

http://blogs.technet.com/b/configmgrteam/archive/2013/10/29/understanding-the-configuration-manager-content-library.aspx