PowerShell Commands

Set-SmbServerConfiguration

Set-SmbServerConfiguration [-AnnounceComment <String>] [-AnnounceServer <Boolean>] [-AsynchronousCredits <UInt32>][-AutoDisconnectTimeout <UInt32>] [-AutoShareServer <Boolean>] [-AutoShareWorkstation <Boolean>] [-CachedOpenLimit<UInt32>] [-CimSession <CimSession[]>] [-DurableHandleV2TimeoutInSeconds <UInt32>] [-EnableAuthenticateUserSharing<Boolean>] [-EnableDownlevelTimewarp <Boolean>] [-EnableForcedLogoff <Boolean>] [-EnableLeasing <Boolean>][-EnableMultiChannel <Boolean>] [-EnableOplocks <Boolean>] [-EnableSecuritySignature <Boolean>][-EnableSMB1Protocol <Boolean>] [-EnableSMB2Protocol <Boolean>] [-EnableStrictNameChecking <Boolean>][-EncryptData <Boolean>] [-Force] [-IrpStackSize <UInt32>] [-KeepAliveTime <UInt32>] [-MaxChannelPerSession<UInt32>] [-MaxMpxCount <UInt32>] [-MaxSessionPerConnection <UInt32>] [-MaxThreadsPerQueue <UInt32>][-MaxWorkItems <UInt32>] [-NullSessionPipes <String>] [-NullSessionShares <String>] [-OplockBreakWait <UInt32>][-PendingClientTimeoutInSeconds <UInt32>] [-RejectUnencryptedAccess <Boolean>] [-RequireSecuritySignature<Boolean>] [-ServerHidden <Boolean>] [-Smb2CreditsMax <UInt32>] [-Smb2CreditsMin <UInt32>][-SmbServerNameHardeningLevel <UInt32>] [-ThrottleLimit <Int32>] [-TreatHostAsStableStorage <Boolean>][-ValidateAliasNotCircular <Boolean>] [-ValidateShareScope <Boolean>] [-ValidateShareScopeNotAliased <Boolean>][-ValidateTargetName <Boolean>] [-Confirm] [-WhatIf] [<CommonParameters>]

The Set-SmbServerConfiguration cmdlet sets the Server Message Block (SMB) Service configuration.

Parameters

-AnnounceComment [<String>]

Specifies the announce comment string.

-AnnounceServer [<Boolean>]

Indicates that this server announces itself by using browser announcements.

-AsynchronousCredits [<UInt32>]

Specifies the asynchronous credits.

-AutoDisconnectTimeout [<UInt32>]

Specifies the auto disconnect time-out.

-AutoShareServer [<Boolean>]

Indicates that the default server shares are shared out.

-AutoShareWorkstation [<Boolean>]

Indicates whether the default workstation shares are shared out.

-CachedOpenLimit [<UInt32>]

Specifies the maximum number of cached open files.

-CimSession [<CimSession[]>]

Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such as the output of a New-CimSession or Get-CimSession cmdlet. The default is the current session on the local computer.

-DurableHandleV2TimeoutInSeconds [<UInt32>]

Specifies the durable handle v2 time-out period, in seconds.

-EnableAuthenticateUserSharing [<Boolean>]

Indicates whether authenticate user sharing is enabled.

-EnableDownlevelTimewarp [<Boolean>]

Indicates whether down-level timewarp support is disabled.

-EnableForcedLogoff [<Boolean>]

Indicates whether forced logoff is enabled.

-EnableLeasing [<Boolean>]

Indicates whether leasing is disabled.

-EnableMultiChannel [<Boolean>]

Indicates whether multi-channel is disabled.

-EnableOplocks [<Boolean>]

Indicates whether the opportunistic locks are enabled.

-EnableSecuritySignature [<Boolean>]

Indicates whether the security signature is enabled.

-EnableSMB1Protocol [<Boolean>]

Indicates whether the SMB1 protocol is enabled.

-EnableSMB2Protocol [<Boolean>]

Indicates whether the SMB2 protocol is enabled.

-EnableStrictNameChecking [<Boolean>]

Indicates whether the server should perform strict name checking on incoming connects.

-EncryptData [<Boolean>]

Indicates whether the sessions established on this server are encrypted.

-Force [<SwitchParameter>]

Forces the command to run without asking for user confirmation.

-IrpStackSize [<UInt32>]

Specifies the default IRP stack size.

-KeepAliveTime [<UInt32>]

Specifies the keep alive time.

-MaxChannelPerSession [<UInt32>]

Specifies the maximum channels per session.

-MaxMpxCount [<UInt32>]

Specifies the maximum MPX count for SMB1.

-MaxSessionPerConnection [<UInt32>]

Specifies the maximum sessions per connection.

-MaxThreadsPerQueue [<UInt32>]

Specifies the maximum threads per queue.

-MaxWorkItems [<UInt32>]

Specifies the maximum SMB1 work items.

-NullSessionPipes [<String>]

Specifies the null session pipes.

-NullSessionShares [<String>]

Specifies the null session shares.

-OplockBreakWait [<UInt32>]

Specifies how long the create caller waits for an opportunistic lock break.

-PendingClientTimeoutInSeconds [<UInt32>]

Specifies the pending client time-out period, in seconds.

-RejectUnencryptedAccess [<Boolean>]

Indicates whether the client that does not support encryption is denied access if it attempts to connect to an encrypted share.

-RequireSecuritySignature [<Boolean>]

Indicates whether the security signature is required.

-ServerHidden [<Boolean>]

Indicates whether the server announces itself.

-Smb2CreditsMax [<UInt32>]

Specifies the maximum SMB2 credits.

-Smb2CreditsMin [<UInt32>]

Specifies the minimum SMB2 credits.

-SmbServerNameHardeningLevel [<UInt32>]

Specifies the SMB Service name hardening level.

-ThrottleLimit [<Int32>]

Specifies the maximum number of concurrent operations that can be established to run the cmdlet. If this parameter is omitted or a value of 0 is entered, then Windows PowerShellr calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer. The throttle limit applies only to the current cmdlet, not to the session or to the computer.

-TreatHostAsStableStorage [<Boolean>]

Indicates whether the host is treated as the stable storage.

-ValidateAliasNotCircular [<Boolean>]

Indicates whether the aliases that are not circular are validated.

-ValidateShareScope [<Boolean>]

Indicates that the existence of share scopes is checked during share creation.

-ValidateShareScopeNotAliased [<Boolean>]

Indicates whether the share scope being aliased is validated.

-ValidateTargetName [<Boolean>]

Indicates whether the target name is validated.

-Confirm [<SwitchParameter>]

  • Default value is false

Prompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.

-WhatIf [<SwitchParameter>]

  • Default value is false

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

<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,ErrorAction, ErrorVariable, WarningAction, WarningVariable,OutBuffer, PipelineVariable, and OutVariable.

Inputs
None
Outputs
None
Examples
  1. Set the SMB Service configuration:
    PS C:\> Set-SmbServerConfiguration -MaxChannelPerSession 16
    Confirm Are you sure you want to perform this action? Performing operation 'Modify' on Target 'SMB Service Configuration'. [Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"):
    

    This command sets the SMB Service configuration.

  2. Set the SMB Service configuration without confirmation:
    PS C:\> Set-SmbServerConfiguration -MaxChannelPerSession 32 -Force
    

    This command sets the SMB Service configuration without user confirmation.

This work is licensed under a Creative Commons Attribution 4.0 International. It is attributed to Microsoft Corporation and can be found here.

PowerShell Commands