Windows Server R2 SMB PowerShell command

Source: Internet
Author: User
Tags file system

PowerShell 4.0 is one of the many improvements in management features of Windows 8.1 and Windows Server R2. We have introduced the "Top Ten PowerShell 4.0 Orders" before. Here we focus on some of the SMB-related improvements in the PowerShell cmdlet listed in the foreign site Serverwatch, which covers the new SMB 3.02 features.

Applying AMB share ACLs to file system ACLs

Sometimes you may want to use and copy ACLs for shared files in shared system folders. Before you need to do the following work:

(Get-smbshare-name Share1). Presetpathacl | Set-acl

But now a new PowerShell cmdlet can be used to copy shared ACLs to file system ACLs, and the syntax is simplified as follows:

Set-smbpathacl-sharename Share1

Set bandwidth limits for SMB sharing

You can now set bandwidth limits for SMB sharing by using the PowerShell cmdlet based on the following categories:

Virtualmachine: Can be used for Hyper-V hosts to limit Hyper-V.

Livemigration: Can be used to restrict Hyper-V dynamic migration on Hyper-V hosts.

Default: Any SMB host can be used to restrict any other type of SMB traffic.

You can use the following command to start the SMB bandwidth throttling feature:

Add-windowsfeature FS-SMBBW

You can then use the following PowerShell cmdlet to manage SMB bandwidth throttling:

Get-smbbandwidthlimit [-category {default/virtualmachine/livemigration}]

set-smbbandwidthlimit-category {default/virtualmachine/livemigration}-bytespersecond X

remove-smbbandwidthlimit-category {default/virtualmachine/livemigration}

The Bytespersecond parameter specifies the unit type. such as KB, MB, or GB. Remember, the bandwidth limit cannot be set to less than 1MB (1048576 bytes).

Increase security by disabling SMB v1

Disabling SMB 1 support can help improve security if you no longer use any legacy OS such as Windows 2000, XP, or shared on the server 2003/r2. Use the following command to prohibit:

Remove-windowsfeature FS-SMB1

If necessary, you can re-enable SMB 1 support with the following command:

Add-windowsfeature FS-SMB1

View the details that have been redirected

In the Windows Server R2 environment, when a client connects to an extensible cluster, the Per-share redirection feature is available if the cluster lacks direct I/o support. Now, using the PowerShell dmdlet below, you can see the details of the feature.

Get-smbconnection: If the Per-share redirection feature is enabled, a new redirected Boolean property is displayed

Get-smbwitnessclient: The new ShareName property.

Get-smbwitnessclient: A new flag property will show "sharing"

SMB Witness Other Related cmdlet improvements

The biggest change in SMB witness is per-share redirection. But the associated PowerShell cmdlet also has a slight improvement. For example, the new cmdlet move-smbclient can be used instead of move-smbwitnessclient. Additionally, the new NetworkName parameter can specify a specific networkname. Previously, you need to enter the following command:

Move-smbwitnessclient-clientname X-destinationnode Y

But now you can enter the following syntax:

Move-smbclient-clientname x-destinationnode Y [-networkname Z

In addition, the default view/list displayed by the Get-smbwitnessclient cmdlet has also been improved.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.