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 = [Math]::Round(($BitsTransfer.BytesTotal/ 1GB),2)
BytesTransferred = $BitsTransfer.BytesTransferred
PercentComplete = [Math]::Round((100 * ($BitsTransfer.BytesTransferred / $BitsTransfer.BytesTotal)),2)
CreationTime = $BitsTransfer.CreationTime
TransferCompletionTime = $BitsTransfer.TransferCompletionTime
}
}
} -HideComputerName
}
Hi ..Thanks for very useful script but when i am trying to execute the same i am getting blank output.
Please suggest !!
Just what I was looking for today! Very nice, thank you!
run across this today looking for a way to monitor percentage of content downloaded via the OsdDownloadContent.exe tool in a task sequence. has anyone run across a powershell cmdlet like the get-bitstransfer to be able to get stats on the osddownloadcontent tool?