Friday, October 26, 2018

CcmGetOSVersion failed with 0x80041010

Client error with this code  0x80041010 is due to the WMI issues


Please use below command to resolve this issue












  1. cleanup sccm client 
  2. Open a command prompt with elevated.
  3. Change to directory C:\Windows\system32\wbem\
  4. Run: dir /b *.mof *.mfl | findstr /v /i uninstall > moflist.txt & for /F %s in (moflist.txt) do mofcomp %s
  5. Install SCCM Client 

Wednesday, October 24, 2018

Use command to lock user to change background or wallpaper for Windows 10 (Applies to all version)


Create OSD task sequence command line and type this command after changed desktop.

REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\ActiveDesktop /V NoChangingWallPaper /T REG_DWORD /D 1 /F

Find and delete specific driver from Powershell

Hi All,

Please see below how to find and delete driver using Powershell .


1. Find driver using  below command from powershell

Get-WmiObject Win32_PnPSignedDriver 

2. You may export to a text file
Get-WmiObject Win32_PnPSignedDriver >c:\driver.txt
















3. filter driver and oem
| where {$_.DeviceName -like "*NVIDIA*" -and $_.InfName -like "*oem*"} 


4. Use this command to delete

$x=Get-WmiObject Win32_PnPSignedDriver | where {$_.DeviceName -like "*NVIDIA*" -and $_.InfName -like "*oem*"} 
foreach($InfName in $x){ 
pnputil -f -d $x.InfName



Wednesday, October 17, 2018

Force ConfigMgr Compliance Baseline Evaluation on Multiple Machines with PowerShell





#Replace with name of Baseline
$BLString = "BaselineName"
 
#Replace with path to input csv (with field containing machines named Name)
$file = "c:\temp\input.csv"
 
$CountProcessed = 0
$rows = (Import-Csv $file).count
 
Import-Csv $file | ForEach-Object {
 
$ComputerName = $_."Name"
 
$CountProcessed++
$percent = (($CountProcessed/$rows)*100)
 
Cls
Write-host "$('{0:N2}' -f $percent)% complete"
 
$Online = Test-Connection -Computername $ComputerName -BufferSize 16 -Count 1 -Quiet
 
If ($Online -eq "True") {
$BLname = Get-WmiObject -ComputerName $ComputerName -Namespace root\ccm\dcm -Class SMS_DesiredConfiguration | Where-Object {$_.DisplayName -match $BLString} | Select-Object -ExpandProperty Name
$version = Get-WmiObject -ComputerName $ComputerName -Namespace root\ccm\dcm -Class SMS_DesiredConfiguration | Where-Object {$_.DisplayName -match $BLString} | Select-Object -ExpandProperty Version
$MC = [WmiClass]"\\$ComputerName\root\ccm\dcm:SMS_DesiredConfiguration"
 
$Method = "TriggerEvaluation"
$InParams = $mc.psbase.GetMethodParameters($Method)
$InParams.IsEnforced = $true
$InParams.IsMachineTarget = $false
$InParams.Name = "$BLname"
$InParams.Version = "$version"
$inparams.PSBase.properties | select Name,Value | Out-Null
$R = $MC.InvokeMethod($Method, $InParams, $null)
$R | Out-Null}
}
Write-Host "Processed" $CountProcessed "of" $rows


The input file should be formatted as follows:
Name
Machine 1
Machine 2
Machine 3
etc..


Original post from http://richardchesterton.com/force-configmgr-compliance-baseline-evaluation-on-multiple-machines-with-powershell/