Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Powershell: New-SMBshare cmdlet not working on remote server.

$
0
0

I am trying to make an all-in-one script which will create a share folder on a server, permission it (NTFS), share it, set share permissions, then set the DFS folder and target. All of this works fine so far (at least in individual parts), except for the Share part.

My code looks OK.

To test, If I create/permission the share locally, there is no problem. Example:

New-SmbShare –Name test1 –Path C:\test -FullAccess Administrators

This works fine.

BUT, if I try the same on the server, I get this error: "The filename, directory name, or volume label syntax is incorrect." Example:

New-SmbShare -name test1 -path \ \server\e$\data -FullAccess Administrators

I am not sure what the error means (Google was not either), but I am wondering if I am entering the server address syntax incorrectly...or is remote share creation even possible with Powershell? Every example I have seen on the web shows a local creation.

Thanks!




Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>