SOLVED

BITS

%3CLINGO-SUB%20id%3D%22lingo-sub-1364278%22%20slang%3D%22en-US%22%3ERe%3A%20BITS%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1364278%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F641252%22%20target%3D%22_blank%22%3E%40dcs19%3C%2FA%3E%26nbsp%3B-%20You%20can%20clear%20out%20individual%20jobs%20and%20cached%20entries%20using%20the%20remove-bitstransfer%20cmdlet.%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fbitstransfer%2Fremove-bitstransfer%3Fview%3Dwin10-ps%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fbitstransfer%2Fremove-bitstransfer%3Fview%3Dwin10-ps%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1364253%22%20slang%3D%22en-US%22%3EBITS%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1364253%22%20slang%3D%22en-US%22%3E%3CP%3EDo%20you%20have%20any%20scripts%2Fguidance%20of%20clearing%20down%20bits%20with%20a%20ci%20for%20example%20on%20jobs%20that%20have%20stalled%2C%20errored%20etc.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20the%20end%20I%20ended%20up%20borrowing%20bits%20of%20anders%20rodland%20excellent%20script%20from%20his%20configmgr%20client%20health%20script%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fwww.andersrodland.com%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.andersrodland.com%2F%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eso%20I%20ended%20up%20with%20a%20very%20rough%20ci%20script%20for%20sccm%20to%20clear%20down%20bits%20I'm%20sure%20it%20can%20be%20improved%20upon%20but%20it%20does%20the%20job%20for%20me.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBits%20Error%20detection%20CI%3C%2FP%3E%3CP%3E%24Errors%20%3D%20%22%22%3CBR%20%2F%3E%24Errors%20%3D%20Get-BitsTransfer%20-AllUsers%20%7C%20Where-Object%20%7B%20(%24_.JobState%20-like%20%22TransientError%22)%20-or%20(%24_.JobState%20-like%20%22Transient_Error%22)%20-or%20(%24_.JobState%20-like%20%22Error%22)%20%7D%3CBR%20%2F%3Eif%20(%24Errors%20-eq%20%22%22)%20%7B%3CBR%20%2F%3E%3CBR%20%2F%3E%7D%3CBR%20%2F%3EElse%3CBR%20%2F%3E%7B%3CBR%20%2F%3Ereturn%20%22False%22%3CBR%20%2F%3E%7D%3CBR%20%2F%3Ereturn%20%22True%22%3C%2FP%3E%3CP%3E%3CBR%20%2F%3ERemediation%3C%2FP%3E%3CP%3E%24Errors%20%3D%20%22%22%3CBR%20%2F%3E%24Errors%20%3D%20Get-BitsTransfer%20-AllUsers%20%7C%20Where-Object%20%7B%20(%24_.JobState%20-like%20%22TransientError%22)%20-or%20(%24_.JobState%20-like%20%22Transient_Error%22)%20-or%20(%24_.JobState%20-like%20%22Error%22)%20%7D%3CBR%20%2F%3E%3CBR%20%2F%3E%24Errors%20%7C%20Remove-BitsTransfer%20-ErrorAction%20SilentlyContinue%3CBR%20%2F%3EInvoke-Expression%20-Command%20'sc.exe%20sdset%20bits%20%22D%3A(A%3B%3BCCLCSWRPWPDTLOCRRC%3B%3B%3BSY)(A%3B%3BCCDCLCSWRPWPDTLOCRSDRCWDWO%3B%3B%3BBA)(A%3B%3BCCLCSWLOCRRC%3B%3B%3BAU)(A%3B%3BCCLCSWRPWPDTLOCRRC%3B%3B%3BPU)%22'%20%7C%20out-null%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Regular Visitor

Do you have any scripts/guidance of clearing down bits with a ci for example on jobs that have stalled, errored etc.

 

Thanks

 

In the end I ended up borrowing bits of anders rodland excellent script from his configmgr client health script https://www.andersrodland.com/ 

 

so I ended up with a very rough ci script for sccm to clear down bits I'm sure it can be improved upon but it does the job for me.

 

Bits Error detection CI

$Errors = ""
$Errors = Get-BitsTransfer -AllUsers | Where-Object { ($_.JobState -like "TransientError") -or ($_.JobState -like "Transient_Error") -or ($_.JobState -like "Error") }
if ($Errors -eq "") {

}
Else
{
return "False"
}
return "True"


Remediation

$Errors = ""
$Errors = Get-BitsTransfer -AllUsers | Where-Object { ($_.JobState -like "TransientError") -or ($_.JobState -like "Transient_Error") -or ($_.JobState -like "Error") }

$Errors | Remove-BitsTransfer -ErrorAction SilentlyContinue
Invoke-Expression -Command 'sc.exe sdset bits "D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)"' | out-null

 

 

 

1 Reply
Highlighted
Best Response confirmed by dcs19 (Regular Visitor)
Solution

@dcs19 - You can clear out individual jobs and cached entries using the remove-bitstransfer cmdlet. https://docs.microsoft.com/en-us/powershell/module/bitstransfer/remove-bitstransfer?view=win10-ps