Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

i am trying to use the powershell start-bitstransfer cmdlets to transfer a file i have exposed using a vss snapshot (via diskshadow), but unfortunately i am receiving the following error:

Start-BitsTransfer : The media is write protected. At line:1 char:49 + Import-CSV c:\hda1\bits.txt | start-bitstransfer <<<< -transfertype upload -Authentication "Basic" -Credential $cred + CategoryInfo : InvalidOperation: (:) [Start-BitsTransfer], Exception + FullyQualifiedErrorId : StartBitsTransferCOMException,Microsoft.BackgroundIntelligentTransfer.Management.NewBits TransferCommand

we really want to utilize the bits endpoint we are attempting to transfer the files to. is there any other way we can go about this (aside from copying the files elsewhere first, unless we can copy one slice at a time and transfer that)?

share|improve this question

1 Answer 1

I was running into the same problem as you. The only way around this is by using bits via http. I am using the bits compact server

The bits compact server is managed with wmi. Following code can create a url for a file:

## Get BITS Compact Server WMI Class
$bcs = [wmiclass] "root\Microsoft\bits:Bitscompactserverurlgroup"

## Create URLGroup
$bcs.CreateUrlGroup("http://+:80/Demo/")

## Get created URLGroups object
$urlgroup = Get-WmiObject -Namespace "root\Microsoft\bits" -Class Bitscompactserverurlgroup" -Filter "urlgroup='http://+:80/Demo/'"

## Host a file. The file has to be present and accessible"
$urlgroup.CreateUrl("file.dat", "F:\shadow\bits1\file.dat", "")

(code from http://blogs.msdn.com/b/wmi/archive/2009/08/18/bits-compact-server-wmi-provider.aspx)

Now you can download the file using

Start-BitsTransfer -Source "http://localhost/demo/file.dat" -Destination j:\ 
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.