Monday, 4 April 2022

Evaluate ConfigMgr Client Policy with PowerShell

Evaluate ConfigMgr Client Policy with PowerShell

$trigger = "{00000000-0000-0000-0000-000000000021}"
Invoke-CimMethod -Namespace 'root\ccm' -ClassName 'sms_client' -MethodName TriggerSchedule -Arguments @{sScheduleID=$trigger}
Start-Sleep -Seconds 10

WMI Triggers for policy evaluation

{00000000-0000-0000-0000-000000000001} Hardware Inventory
{00000000-0000-0000-0000-000000000002} Software Inventory 
{00000000-0000-0000-0000-000000000003} Discovery Inventory 
{00000000-0000-0000-0000-000000000010} File Collection 
{00000000-0000-0000-0000-000000000011} IDMIF Collection 
{00000000-0000-0000-0000-000000000012} Client Machine Authentication 
{00000000-0000-0000-0000-000000000021} Request Machine Assignments 
{00000000-0000-0000-0000-000000000022} Evaluate Machine Policies 
{00000000-0000-0000-0000-000000000023} Refresh Default MP Task 
{00000000-0000-0000-0000-000000000024} LS (Location Service) Refresh Locations Task 
{00000000-0000-0000-0000-000000000025} LS (Location Service) Timeout Refresh Task 
{00000000-0000-0000-0000-000000000026} Policy Agent Request Assignment (User) 
{00000000-0000-0000-0000-000000000027} Policy Agent Evaluate Assignment (User) 
{00000000-0000-0000-0000-000000000031} Software Metering Generating Usage Report 
{00000000-0000-0000-0000-000000000032} Source Update Message
{00000000-0000-0000-0000-000000000037} Clearing proxy settings cache 
{00000000-0000-0000-0000-000000000040} Machine Policy Agent Cleanup 
{00000000-0000-0000-0000-000000000041} User Policy Agent Cleanup
{00000000-0000-0000-0000-000000000042} Policy Agent Validate Machine Policy / Assignment 
{00000000-0000-0000-0000-000000000043} Policy Agent Validate User Policy / Assignment 
{00000000-0000-0000-0000-000000000051} Retrying/Refreshing certificates in AD on MP 
{00000000-0000-0000-0000-000000000061} Peer DP Status reporting 
{00000000-0000-0000-0000-000000000062} Peer DP Pending package check schedule 
{00000000-0000-0000-0000-000000000063} SUM Updates install schedule 
{00000000-0000-0000-0000-000000000071} NAP action 
{00000000-0000-0000-0000-000000000101} Hardware Inventory Collection Cycle 
{00000000-0000-0000-0000-000000000102} Software Inventory Collection Cycle 
{00000000-0000-0000-0000-000000000103} Discovery Data Collection Cycle 
{00000000-0000-0000-0000-000000000104} File Collection Cycle 
{00000000-0000-0000-0000-000000000105} IDMIF Collection Cycle 
{00000000-0000-0000-0000-000000000106} Software Metering Usage Report Cycle 
{00000000-0000-0000-0000-000000000107} Windows Installer Source List Update Cycle 
{00000000-0000-0000-0000-000000000108} Software Updates Assignments Evaluation Cycle 
{00000000-0000-0000-0000-000000000109} Branch Distribution Point Maintenance Task 
{00000000-0000-0000-0000-000000000110} DCM policy 
{00000000-0000-0000-0000-000000000111} Send Unsent State Message 
{00000000-0000-0000-0000-000000000112} State System policy cache cleanout 
{00000000-0000-0000-0000-000000000113} Scan by Update Source 
{00000000-0000-0000-0000-000000000114} Update Store Policy 
{00000000-0000-0000-0000-000000000115} State system policy bulk send high
{00000000-0000-0000-0000-000000000116} State system policy bulk send low 
{00000000-0000-0000-0000-000000000120} AMT Status Check Policy 
{00000000-0000-0000-0000-000000000121} Application manager policy action 
{00000000-0000-0000-0000-000000000122} Application manager user policy action
{00000000-0000-0000-0000-000000000123} Application manager global evaluation action 
{00000000-0000-0000-0000-000000000131} Power management start summarizer
{00000000-0000-0000-0000-000000000221} Endpoint deployment reevaluate 
{00000000-0000-0000-0000-000000000222} Endpoint AM policy reevaluate 
{00000000-0000-0000-0000-000000000223} External event detection
Share:

Thursday, 31 March 2022

SQL Querrey to get Enforcement states for a software updates deployment

Enforcement states for the software updates department

select
 sn.StateName as LastEnforcementState,
 vrs.name0 as ComputerName,
 a.AssignmentName as DeploymentName,
 assc.StateTime ,
 a.CollectionName
 from v_CIAssignment a
 join v_AssignmentState_Combined assc on a.AssignmentID=assc.AssignmentID
 join v_StateNames sn on assc.StateType = sn.TopicType and sn.StateID=isnull(assc.StateID,0)
 join v_R_System vrs on vrs.ResourceID=assc.ResourceID
 where 
a.AssignmentID='xxxxxxxx'
--or a.Assignment_UniqueID like '************'
 order by LastEnforcementState

Query Results:-

Share:

Sunday, 20 February 2022

Client updates scan error 0x8024400D

If you get scan error 0x8024400D on the


 WindowsUpdate.log

“WARNING: SyncUpdates failure, error = 0x8024400D, soap client error = 7, soap error code = 300, HTTP status code = 200”


or is it reported to the server you could run the following PowerShell to fix the client that is not sending back the Scan results


$Path_WU = get-childitem env:windir
$Path_WU_Org = $Path_WU.value + "\SoftwareDistribution"
write-host (" ")
write-host ("Source folder: ") -foreground yellow -nonewline; write-host ($Path_WU_Org) -foreground green
write-host (" ")
write-host ("Cleaning up UpdateStore WMI") -foreground yellow
write-host (" ")
$WMI_CACHE_WU = Get-WmiObject -Class CCM_UpdateStatus -Namespace ROOT\ccm\SoftwareUpdates\UpdatesStore -ComputerName localhost
$WMI_CACHE_WU | Remove-WmiObject
write-host ("Stopping WUA") -foreground yellow
write-host (" ")
net stop "wuauserv"
sleep 30
write-host ("Renaming folder: ") -foreground yellow -nonewline; write-host ($Path_WU_Org) -foreground green
write-host (" ")
Rename-Item -Path $Path_WU_Org -NewName "SoftwareDistribution.old"
write-host ("Starting WUA") -foreground yellow
write-host (" ")
net start "wuauserv"
Share:

Wednesday, 10 November 2021

WQL quality to create collection with IP range

select

SMS_R_SYSTEM.ResourceID, SMS_R_SYSTEM.ResourceType, SMS_R_SYSTEM.Name, SMS_R_SYSTEM.SMSUniqueIdentifier, SMS_R_SYSTEM.ResourceDomainORWorkgroup, SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System NETWORK_ADAPTER_CONFIGURATION on

SMS_G_System_NETWORK_ADAPTER_CONFIGURATION.ResourceId = SMS_R_System.ResourceId where SMS_G_System_NETWORK_ADAPTER_CONFIGURATION.IPAddress like "10.%" or

SMS G_System_NETWORK_ADAPTER_CONFIGURATION.IPAddress like "172.%"
Share:

Sunday, 7 November 2021

CMTrace


https://docs.microsoft.com/en-us/troubleshoot/mem/configmgr/long-line-causes-log-truncated

A log that has a line exceeding 8000 characters is truncated in the CMTrace log viewer.
Viewing the log file in Notepad will allow you to see all of the content.
Share:

Friday, 22 October 2021

Tuesday, 19 October 2021

SCCM logs location

Srever Based logs

• Location of Configuration Manager Setup/Site Server Installation logs: o Root of drive C

Location of Site Server log files: o installation Path>\Logs

. Location of Site system (remote) log files (that is Site Component Server): a <drive with most free space>\sms\logs

. Location of Management Point log files: Co-located with Site Server: <Installation Path>\SMS CCM\Logs If Configuration Manager client. installed first, the location of the Management

log files: %WINDIR%\CCM\logs

Location of Console log file:

o <Installation Path>\Admin Console AdminUlLog SMSAdmin Ut.log

Out sied of SCCM Logs location

. Windows Update Agent Log files

o%WINDIR%\Windows Update.log

o Get-Windows UpdateLog (Windows 10, Windows Server 2016)

WSUS Server Log files

o Located in %6Program Files%\Update Services LogFiles

o Change.log

o Software Distribution.Log

Policy Platform (Lantern) Log Files o%Program Files\Microsoft Policy Platform PolicyPlatformClient log

• Internet Information Services (IIS) Log files

o %SYSTEMDRIVE%\inetpub\logs\LogFiles\W3SVC1
Share: