Part - 10 : Creating new File Shares.

There is one particular task which every I.T. Admin does on their server. Guess what it is?

It's creating network shares on server. Creating new network shares in Server2012R2 are very easy. We simple need to use the cmdlet New-SmbShare .

Let's create a network share folder using PowerShell. Before setup sharing, we need to create a folder first.

In the below command, we are creating a new folder using New-Item cmdlet, we are creating a folder name ''MarketingImages" , and creating it in the 'C:\' drive root.

New-Item-Path'C:\'-Name'MarketingImages'-TypeDirectory

In the above screenshot, you can see that our folder have created successfully.

Now, we need to share it, we do use the New-SmbShare cmdlet for sharing the folder. In the below command, in -Name we have provide the sharing name , which is "Makrting Images" ,-Path in we have give the physical path of the folder which is C:\MarketingImages, We are giving the read only access to everyone, so we used -ReadAccess "Everyone", I am using the AccessBased in -FolderEnumeration Mode, and in -Description, I have provided a description about the folder.