How to Enable and Use New-SMBShare in PowerShell 3.0 on Windows 7


4 views

When attempting to use SMB-related PowerShell cmdlets after installing Windows Management Framework 3.0 on Windows 7, many administrators find that the expected New-SMBShare cmdlet is unavailable. This occurs because the SMB cmdlets weren't included in the base WMF 3.0 package for Windows 7.

To access the modern SMB cmdlets on Windows 7, you'll need:

  1. Windows 7 SP1 (64-bit recommended)
  2. Windows Management Framework 3.0 installed
  3. Additional SMB components from Windows 8/Server 2012

The SMB cmdlets are part of the SmbShare module which wasn't backported to Windows 7. Here are two approaches:

Option 1: Manual Module Import

You can manually copy the required files from a Windows 8/Server 2012 system:


# Copy these files from a Windows 8/Server 2012 system to your Windows 7 machine:
# - %WinDir%\System32\WindowsPowerShell\v1.0\Modules\SmbShare
# - %WinDir%\System32\smbwitness.dll
# - %WinDir%\System32\smbshare.psm1
# - %WinDir%\System32\smbshare.psd1

# Then import the module manually:
Import-Module -Name SmbShare

Option 2: Feature Installation (Recommended)

For a more stable solution, install the SMB 3.0 components from Windows 8/Server 2012:


# First verify if SMB components are available:
Get-WindowsFeature -Name FS-SMB*

# If not available, you'll need to install the Server Message Block 3.0 components
# This typically requires downloading the Windows 8/Server 2012 SMB package

After implementing either solution, verify cmdlet availability:


# Check available SMB cmdlets:
Get-Command -Module SmbShare

# List existing SMB shares:
Get-SmbShare

# Create a new SMB share (example):
New-SmbShare -Name "DataShare" -Path "C:\SharedData" -FullAccess "DOMAIN\Users"

If the above solutions aren't feasible, consider these alternatives:

  • Use the legacy net share command
  • Upgrade to Windows 8.1/10 or Server 2012 R2/2016
  • Implement the share through Group Policy Preferences

Common issues and their solutions:


# Error: "The term 'New-SmbShare' is not recognized..."
Solution: Verify module import with: Get-Module -Name SmbShare

# Error: "Access is denied"
Solution: Run PowerShell as Administrator

# Error: "The network path was not found"
Solution: Ensure the Server service is running (Get-Service -Name LanmanServer)

For production environments, consider testing these changes in a controlled environment before deployment.


After installing Windows Management Framework 3.0 (WMF 3.0) on Windows 7, many administrators expect to find the modern SMB sharing cmdlets like New-SMBShare, but running Get-Command -Module *smb* returns nothing. This occurs because the SMB cmdlets weren't included in WMF 3.0 - they were introduced later in Windows 8/Server 2012.

Here are three approaches to achieve SMB share management on Windows 7:

Option 1: Using Legacy NET SHARE Command

# Create a basic share
net share TestShare=C:\Temp /grant:Everyone,READ

# View existing shares
net share

# Remove a share
net share TestShare /delete

Option 2: Using WMI Through PowerShell

# Create share with WMI
$shareClass = [wmiclass]"Win32_Share"
$shareClass.Create("C:\Temp", "TestShare", 0, $null, "Test Share Description")

# List shares
Get-WmiObject -Class Win32_Share | Select-Object Name,Path,Description

# Delete share
(Get-WmiObject -Class Win32_Share -Filter "Name='TestShare'").Delete()

Option 3: Installing RSAT for Advanced Management

For Windows 7 Professional/Enterprise/Ultimate:

  1. Download Remote Server Administration Tools (RSAT) for Windows 7
  2. Install the "File Services Tools" component
  3. This will provide limited SMB management capabilities through MMC snapins

If you need the full New-SMBShare functionality:

  • Consider upgrading to Windows 8.1/10 or Windows Server 2012 R2+
  • These OS versions include the full SMB PowerShell module (SmbShare)
  • Example of modern SMB share creation:
    New-SMBShare -Name "DataShare" -Path "D:\Data" -FullAccess "DOMAIN\Admins" -ReadAccess "DOMAIN\Users" -FolderEnumerationMode AccessBased

Windows 7's SMB implementation has several constraints:

  • Maximum SMB version is 2.1 (no SMB 3.0+ features)
  • No SMB Direct (RDMA) or SMB Multichannel support
  • Limited security features compared to newer Windows versions