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!