Wednesday, November 17, 2021

SCCM / MECM Scan error : Unable to read existing WUA Group Policy object. Error = 0x80004005. fix

Create Task sequence and add the below Script and deploy it silently.

Scan Error : Unable to read existing WUA Group Policy object. Error = 0x80004005.


Below is the fix


Function Write-log

{

Param(

[Parameter(position=0)]

$msg = " ",

$log ="C:\windows\ccm\logs\RenamingRegPol.log" 

)

Add-Content -Path $log -Value ((Get-Date -Format "yyyy-MM-dd hh:mm:ss") + " " + $msg)

 }


try{

Write-log "-----------------------------------------------"

Write-log "Script Started"

Write-log "Renaming Reg.pol file "

if (Test-Path -Path C:\Windows\System32\GroupPolicy\Machine\_Registry.pol)

{

Remove-Item "C:\Windows\System32\GroupPolicy\Machine\_Registry.pol" -Force -ErrorAction Stop

}

Rename-Item -Path C:\Windows\System32\GroupPolicy\Machine\Registry.pol -NewName "_Registry.pol" -ErrorAction Stop

Write-log "Renamed Reg.pol file "

Write-log "Running GP update on the machine "

gpupdate /force

Write-log "Ran GP update on the machine "

}

Catch{

Write-log $($_.exception.message)

}

Write-log "Waiting for 120 seconds"

Start-Sleep 120

Write-log "Refreshing Machine Policy"

Invoke-WmiMethod -Namespace root\ccm -Class SMS_Client -Name TriggerSchedule "{00000000-0000-0000-0000-000000000021}"

Write-log "Waiting for 60 seconds"

Start-Sleep 60

Write-log "Evaluating Machine Policy"

Invoke-WmiMethod -Namespace root\ccm -Class SMS_Client -Name TriggerSchedule "{00000000-0000-0000-0000-000000000022}"

Write-log "Waiting for 60 seconds"

Start-Sleep 60

Write-log "Initiating Scan Cycle"

Invoke-WmiMethod -Namespace root\ccm -Class SMS_Client -Name TriggerSchedule "{00000000-0000-0000-0000-000000000113}"

Write-log "Waiting for 180 seconds"

Start-Sleep 180

Write-log "Initiating Update Deployment Cycle"

Invoke-WmiMethod -Namespace root\ccm -Class SMS_Client -Name TriggerSchedule "{00000000-0000-0000-0000-000000000108}"

Write-log "Waiting for 60 seconds"

Start-Sleep 60

Write-log "Script Completed "

Write-log "-----------------------------------------------"

Tuesday, August 24, 2021

MECM / SCCM SQL Query to get machines from a collection

 select sys.Name0 [Device],

sys.Active0 [Active],

sys.Client0[Client],

sys.Full_Domain_Name0 [Domain],

sys.Creation_Date0 [Creation date]

from v_FullCollectionMembership fcm

join v_R_System sys on fcm.ResourceID=sys.ResourceID

where fcm.CollectionID = 'SMS00001'  --- replace the collection ID  

SCCM Application Deployment Tool

SCCM Application Deployment Tool Streamlining SCCM Application Deployments: Introducing the SCCM Application Deployment Tool. In the realm o...