• Home
  • Cloud VPS
    • Hong Kong VPS
    • US VPS
  • Dedicated Servers
    • Hong Kong Servers
    • US Servers
    • Singapore Servers
    • Japan Servers
  • Company
    • Contact Us
    • Blog
logo logo
  • Home
  • Cloud VPS
    • Hong Kong VPS
    • US VPS
  • Dedicated Servers
    • Hong Kong Servers
    • US Servers
    • Singapore Servers
    • Japan Servers
  • Company
    • Contact Us
    • Blog
ENEN
  • 简体简体
  • 繁體繁體
Client Area

PowerShell Command: New-StorageFileShare

December 16, 2023

PowerShell Command: New-StorageFileShare

When it comes to managing storage in a Windows environment, PowerShell is an incredibly powerful tool. One of the many useful commands available in PowerShell is the New-StorageFileShare command. This command allows you to create a new file share on a server, which can be incredibly useful for a variety of purposes. In this article, we’ll take a closer look at the New-StorageFileShare command, including how to use it and some examples of it in action.

What is the New-StorageFileShare Command?

The New-StorageFileShare command is a part of the Storage module in PowerShell. It allows you to create a new file share on a server, which can then be accessed by other computers on the network. This can be useful for sharing files between computers, setting up a centralized location for backups, or even creating a shared space for collaboration.

How to Use the New-StorageFileShare Command

Using the New-StorageFileShare command is relatively straightforward. The basic syntax for the command is as follows:

New-StorageFileShare -Name "ShareName" -Path "C:PathToShare" -FullAccess "DOMAINUser"

This command will create a new file share with the name “ShareName” at the path “C:PathToShare” and give full access to the specified user. You can also specify additional parameters, such as -ReadAccess or -ChangeAccess, to give different levels of access to different users.

Examples of the New-StorageFileShare Command in Action

Let’s take a look at a few examples of how the New-StorageFileShare command can be used in a real-world scenario.

Example 1: Creating a Basic File Share

New-StorageFileShare -Name "Documents" -Path "C:SharesDocuments" -FullAccess "DOMAINJohnDoe"

This command will create a new file share named “Documents” at the path “C:SharesDocuments” and give full access to the user “JohnDoe”.

Example 2: Creating a File Share with Multiple Access Levels

New-StorageFileShare -Name "Projects" -Path "C:SharesProjects" -FullAccess "DOMAINProjectManagers" -ChangeAccess "DOMAINDevelopers" -ReadAccess "DOMAINEveryone"

This command will create a new file share named “Projects” at the path “C:SharesProjects” and give full access to the “ProjectManagers” group, change access to the “Developers” group, and read access to everyone.

Example 3: Creating a File Share with Custom Permissions

$permissions = @("DOMAINJohnDoe","FullControl","Allow"),("DOMAINJaneDoe","Read","Allow")
New-StorageFileShare -Name "CustomShare" -Path "C:SharesCustom" -CimSession "Server01" -FolderEnumerationMode "AccessBased" -Permission $permissions

This command will create a new file share named “CustomShare” on the server “Server01” with custom permissions for “JohnDoe” and “JaneDoe”.

Conclusion

The New-StorageFileShare command is a powerful tool for managing file shares in a Windows environment. Whether you’re setting up a simple file share for a small team or a complex system with multiple access levels, this command can help you get the job done quickly and efficiently. By incorporating relevant examples and code samples, we’ve shown how the New-StorageFileShare command can be used in a variety of scenarios. If you’re looking for a reliable Hong Kong VPS hosting provider to support your storage needs, look no further than Server.HK. With our Hong Kong VPS Hosting solutions, you can rest assured that your data is safe and secure in the cloud.

Recent Posts

  • How to Set a Static IP Address on a Debian Server: Theory and Best Practices
  • How to Manage Services with systemd on Debian: Theory and Best Practices
  • Debian Server Security Hardening: Best Practices and Core Theory
  • How to Monitor System Resources on a Debian Server: Theory and Best Practices
  • Debian Server Performance Tuning: Best Practices and Core Theory

Recent Comments

No comments to show.

Knowledge Base

Access detailed guides, tutorials, and resources.

Live Chat

Get instant help 24/7 from our support team.

Send Ticket

Our team typically responds within 10 minutes.

logo
Alipay Cc-paypal Cc-stripe Cc-visa Cc-mastercard Bitcoin
Cloud VPS
  • Hong Kong VPS
  • US VPS
Dedicated Servers
  • Hong Kong Servers
  • US Servers
  • Singapore Servers
  • Japan Servers
More
  • Contact Us
  • Blog
  • Legal
© 2026 Server.HK | Hosting Limited, Hong Kong | Company Registration No. 77008912
Telegram
Telegram @ServerHKBot