title: Powershell: New-SMBshare cmdlet not working on remote server
body: <p>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.</p>
  
  <p>My code looks OK.</p>
  
  <p>To test, If I create/permission the share locally, there is no problem. Example:</p>
  
  <p>New-SmbShare –Name test1 –Path C:\test -FullAccess Administrators</p>
  
  <p>This works fine.</p>
  
  <p>BUT, if I try the same on the server, I get this error: "The filename, directory name, or volume label syntax is incorrect." Example:</p>
  
  <p>New-SmbShare -name test1 -path \ \server\e$\data -FullAccess Administrators</p>
  
  <p>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.</p>
  
  <p>Thanks!</p>