Sometimes you want to monitor the progress of a content download on an SCCM client from a distribution point. You can use the Get-BitsTransfer PowerShell cmdlet, but it doesn’t currently support running on remote computers, so I wrapped the cmdlet in a bit of extra code that lets you get Bits transfer information from a remote computer, and adds a couple of extra values like the transfer size in megabytes and gigabytes as well as a percent complete value. Run it while there’s an active transfer to monitor the progress.
Simply provide a computer name like so:
Get-BitsTransfers -ComputerName PC001
Function Get-BitsTransfers { [CmdletBinding()] Param ( [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true, Position=0)] $ComputerName ) Invoke-Command -ComputerName $ComputerName -ScriptBlock { $BitsTransfers = Get-BitsTransfer -AllUsers Foreach ($BitsTransfer in $BitsTransfers) { [pscustomobject]@{ DisplayName = $BitsTransfer.DisplayName JobState = $BitsTransfer.JobState OwnerAccount = $BitsTransfer.OwnerAccount FilesTotal = $BitsTransfer.FilesTotal FilesTransferred = $BitsTransfer.FilesTransferred BytesTotal = $BitsTransfer.BytesTotal MegaBytesTotal = [Math]::Round(($BitsTransfer.BytesTotal / 1MB),2) GigaBytesTotal…
View original post 24 more words