Site icon TOSS

Set-BitsTransfer

powershell

Set-BitsTransfer is accessible with the help of BitsTransfer module. To configure BitsTransfer, go through this link.

Synopsis

Modifies the properties of an existing BITS transfer job.

Description

The Set-BitsTransfer cmdlet modifies the properties of an existing Background Intelligent Transfer Service (BITS) transfer job. You can specify the job that you want to modify in the BitsJob parameter. Or, you can specify the job by passing it through the pipeline.

Parameters

-Authentication

Specifies the authentication mechanism to be used at the server. The acceptable values for this parameter are:

Type:String
Aliases:au
Accepted values:Basic, Digest, Ntlm, Negotiate, Passport
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-BitsJob

Specifies an array of BITS transfer jobs on which this cmdlet sets properties. You can pipe a value to this parameter from other cmdlets that return BitsJob objects, such as Get-BitsTransfer

Type:BitsJob[]
Aliases:b
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False

-Credential

Specifies the credentials to use to authenticate the user at the server. The default is the current user. Type a user name, such as “User01”, “Domain01\User01”, or “User@Contoso.com”. Or, use the Get-Credential cmdlet to create the value for this parameter. When you type a user name, you are prompted for a password.

Type:PSCredential
Aliases:cred
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-Description

Specifies a description for the BITS transfer job. The description is limited to 1,024 characters.

Type:String
Aliases:d
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-DisplayName

Specifies a display name for the BITS transfer job. The display name provides a user-friendly way to differentiate BITS transfer jobs.

Type:String
Aliases:dn
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-Priority

Specifies the priority of the BITS transfer job, which affects bandwidth usage. The acceptable values for this parameter are:

Type:String
Aliases:p
Accepted values:Foreground, High, Normal, Low
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-ProxyAuthentication

Specifies the authentication mechanism to use at the Web proxy. The acceptable values for this parameter are:

Type:String
Aliases:pa
Accepted values:Basic, Digest, Ntlm, Negotiate, Passport
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-ProxyBypass

Specifies a list of host names to use for a direct connection. The hosts in the list are tried in order until a successful connection is achieved. If you specify this parameter the cmdlet bypasses the proxy. If this parameter is used, the ProxyUsage parameter must be set to Override; otherwise, an error occurs.

Type:String[]
Aliases:pb
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-ProxyCredential

Specifies the credentials to use to authenticate the user at the proxy. You can use the Get-Credential cmdlet to create a value for this parameter.

Type:PSCredential
Aliases:pc
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-ProxyList

Specifies an array of proxies to use. The proxies in the list are tried in order until a successful connection is achieved. If this parameter is specified and ProxyUsage is set to a value other than Override, an error occurs.

Type:Uri[]
Aliases:pl
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-ProxyUsage

Specifies the proxy usage settings. The acceptable values for this parameter are:

Type:String
Aliases:pu
Accepted values:SystemDefault, NoProxy, AutoDetect, Override
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-RetryInterval

Specifies the minimum length of time, in seconds, that BITS waits before it attempts to transfer the file after BITS encounters a transient error. The minimum allowed value is 60 seconds. If this value exceeds the RetryTimeout value from the BitsJob object, BITS will not retry the transfer. Instead, BITS sets the state of the BITS transfer job to the Error state.

The default is 600 seconds (10 minutes).

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-RetryTimeout

Specifies the length of time, in seconds, that BITS attempts to transfer the file after the first transient error occurs. Setting the retry period to 0 prevents retries. If the retry period value exceeds the JobInactivityTimeout Group Policy setting (90-day default), BITS cancels the job.

The default value is 1,209,600 seconds (14 days).

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-SetOwnerToCurrentUser

Indicates that the cmdlet sets the owner of the BITS transfer job to the current user.

Type:SwitchParameter
Aliases:so
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-TransferPolicy

Specifies the network cost states in which the transfer is allowed to be scheduled. The current cost state of the network is a bitmask that indicates the kinds of charges that would be incurred if a transfer was scheduled at this time. This cost state represents a bitmask; if the bit corresponding to the current network cost state is set, the transfer can be scheduled. If the bit corresponding to the current network cost state is not set, the transfer is ignored for scheduling purposes. You can submit any of the named values listed here, or add them together to provide a custom value.

The acceptable values for this parameter are:

The cost state also includes one option (IgnoreCongestion) and a set of standard policies (Uncosted, Standard, NoSurcharge, NotRoaming, and Always) which are combinations of the discrete bit values.

The default value is determined by a combination of job priority and group policy. If this value is not explicitly set, it can vary when job priority or current group policy are modified.

Type:CostStates
Accepted values:None, Unrestricted, Capped, BelowCap, NearCap, OverCapCharged, OverCapThrottled, UsageBased, Roaming, IgnoreCongestion, PolicyUnrestricted, Standard, NoSurcharge, NotRoaming, Always
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-UseStoredCredential

Specifies that credentials stored in the Windows Credential Manager should be used for authentication when required for the specified target server type. If this parameter is not specified and a server requires authentication, then explicit credentials must be included by using the Credential or ProxyCredential parameters. This parameter is a flag parameter whose values can be added together to create the desired behavior.

The acceptable values for this parameter are:

Type:AuthenticationTargetValue
Accepted values:None, Server, Proxy
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False

Syntax

Set-BitsTransfer [-BitsJob] <BitsJob[]> [-DisplayName <String>] [-Priority <String>] [-Description <String>] [-ProxyAuthentication <String>] [-RetryInterval <Int32>] [-RetryTimeout <Int32>] [-TransferPolicy <CostStates>] [-UseStoredCredential <AuthenticationTargetValue>] [-Credential <PSCredential>] [-ProxyCredential <PSCredential>] [-Authentication <String>] [-SetOwnerToCurrentUser] [-ProxyUsage <String>] [-ProxyList <Uri[]>] [-ProxyBypass <String[]>] [-WhatIf] [-Confirm] [<CommonParameters>]

—————–Example 1—————–
Modify the priority of a BITS transfer job
PS C:>$Bits = Get-BitsTransfer -JobId <JobID>
PS C:> Set-BitsTransfer -BitsJob $Bits -Priority High
This command modifies the priority of an existing BITS transfer job.
The first command retrieves the BITS transfer job specified by the JobId parameter and then stores it in the $Bits variable.
The second command uses the BitsJobparameter to pass the BitsJob object stored in the $Bits variable to the Set-BitsTransfer cmdlet. The Priority parameter is used to set the priority of the BITS transfer job to High.

—————–Example 2—————–
Set the owner of a set of BITS transfer jobs
PS C:>Get-BitsTransfer -AllUsers -Name Microsoft | Set-BitsTransfer -SetOwnerToCurrentUser
This command makes the current user the owner of a set of existing BITS transfer jobs.
The output of the Get-BitsTransfer cmdlet is a set of BitsJob objects whose display name contains Microsoft. This output is passed to the Set-BitsTransfer cmdlet through the pipeline. The SetOwnerToCurrentUser parameter specifies that the owner of each BITS transfer job is the current user.

—————–Example 3—————–
Modify the proxy settings of a BITS transfer job
PS C:>$Bits = Get-BitsTransfer -JobId <JobID>
PS C:>$Cred = Get-Credential
PS C:>Set-BitsTransfer -BitsJob $Bits -ProxyUsage AutoDetect -ProxyAuthentication $Cred
This command modifies the proxy settings of an existing BITS transfer job.
The first command retrieves the BITS transfer job identified by the JobId parameter and then stores it in the variable named $Bits.
The second command retrieves credentials from the user and then stores them in the $Cred variable.
The third command uses the BitsJob parameter to pass the BitsJob object stored in the $Bits variable to the Set-BitsTransfer cmdlet. It uses the ProxyAuthentication parameter to pass the PSCredential object stored in the $Cred variable. The ProxyUsage parameter allows the BITS transfer job to automatically discover the Web proxy server by using the Web Proxy Autodiscovery Protocol (WPAD) protocol. The supplied set of credentials is used to authenticate the user at the proxy server.

—————–Example 4—————–
Modify the proxy settings of a BITS transfer job using a proxy list and proxy bypass
PS C:>Get-BitsTransfer | Set-BitsTransfer -ProxyUsage Override -ProxyList “http://proxy1”, “http://proxy2:81” -ProxyBypass “http://directconnect”
This command modifies the proxy settings of an existing BITS transfer job.
The output of the Get-BitsTransfer cmdlet is the set of BitsJob objects that are owned by the current user. This output is piped to the Set-BitsTransfer cmdlet. The Override value that is specified in the ProxyUsage parameter indicates that an explicit list of proxy server and bypassed host names are provided.
The ProxyList parameter specifies two proxy servers. The first server in the list (http://proxy1) is used. If that connection fails, the command tries the connection by using the second server in the list (http://proxy2:81). If both connections fail, the job fails.
When a list of host names is specified in the ProxyBypass parameter, the connection that is made is a direct connection that does not use a proxy server. In this example, no proxy server is used to add a file to the BITS transfer queue on the directconnect server.

You can check the Version, CommandType and Source of this cmdlet by giving below command.

Get-Command Set-BitsTransfer

You can also read about

To know more PowerShell cmdlets(Commands) on BitsTransfer click here

Click on this Link for an Single place where you get all the PowerShell cmdlet sorted based on the modules.

You can also refer other blogs on PowerShell at link

You can also refer other blogs on Microsoft at link

And also if you required any technology you want to learn, let us know below we will publish them in our site http://tossolution.com/

Like our page in Facebook and follow us for New technical information.

References are taken from Microsoft

Exit mobile version