3

#PSTip How to create a share in Windows Server 2012

Quite easy, with a one-liner. Windows Server 2012 provides Windows PowerShell cmdlets and WMI objects to manage SMB file servers and SMB file shares. The SMB cmdlets are packaged into two modules called SmbShare and SmbWitness. These modules are automatically loaded (thanks to new module auto-loading feature) whenever you refer to any of the contained cmdlets. No upfront configuration is required. (Note: Check the output of the Get-Module command before and after you run the following one-liner to see that SmbShare module is loaded behind the scenes.)

New-SmbShare –Name MyShare –Path C:\Test –Description ‘Test Shared Folder’ –FullAccess Administrator –ReadAccess Everyone
Filed in: Columns, Tips and Tricks Tags: , , ,

3 Responses to "#PSTip How to create a share in Windows Server 2012"

  1. brandonliveuh says:

    Thank you, this was usefull

  2. Latha says:

    Hi, I tried to use above syntax , but recive below error. Please check it and do needful

    The term ‘New-SmbShare’ is not recognized as the name of a cmdlet, function, script file, or op
    erable program. Check the spelling of the name, or if a path was included, verify that the path
    is correct and try again.

Leave a Reply

Submit Comment

© 2016 PowerShell Magazine. All rights reserved. XHTML / CSS Valid.
Proudly designed by Theme Junkie.
%d bloggers like this: