title: PowerShell: Copy-Item fails despite the same process working with Windows Explorer
body: <p>I have a script that needs to copy files on a regular basis (every hour). I can open the source and destination folder using windows explorer and copy the file without issue.</p>
  
  <p>However, if I try the same thing in PowerShell I get an Access to the path is denied error. I've checked the permissions on the share and I have full access. Why does this fail through PowerShell?</p>
  
  <p>Copy-Item command:</p>
  
  <pre><code>Copy-Item \\idmststtrm2\tns_admin$\tnsnames.ora -Destination \\bts13r2b\tnsnames -Force
  </code></pre>
  
  <p>Errors:</p>
  
  <pre><code>Copy-Item : Access to the path '\\bts13r2b\tnsnames\tnsnames.ora' is denied.
  At line:1 char:1
  + Copy-Item \\idmststtrm2\tns_admin$\tnsnames.ora -Destination \\bts13r2b\tnsnames ...
  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  + CategoryInfo          : PermissionDenied: (\\idmststtrm2\tns_admin$\tnsnames.ora:FileInfo) [Copy-Item], UnauthorizedAccessException
  + FullyQualifiedErrorId : CopyFileInfoItemUnauthorizedAccessError,Microsoft.PowerShell.Commands.CopyItemCommand
  
  Copy-Item : Access to the path '\\bts13r2b\tnsnames\tnsnames.ora' is denied.
  At line:1 char:1
  + Copy-Item \\idmststtrm2\tns_admin$\tnsnames.ora -Destination \\bts13r2b\tnsnames ...
  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  + CategoryInfo          : NotSpecified: (:) [Copy-Item], UnauthorizedAccessException
  + FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.PowerShell.Commands.CopyItemCommand
  </code></pre>
  
  <p>Edits:</p>
  
  <p>When I execute a <code>Get-ChildItem</code> against the destination path, I'm able to see the folder contents.</p>
  
  <p>Results from get-item:</p>
  
  <pre><code>get-item \\idmststtrm2\tns_admin$\tnsnames.ora
  
  Directory: \\idmststtrm2\tns_admin$
  
  
  Mode                LastWriteTime     Length Name                                                                      
  ----                -------------     ------ ----                                                                      
  -a---         3/10/2017   8:49 AM      14143 tnsnames.ora                                                              
  
  
  get-item \\bts13r2b\tnsnames\tnsnames.ora
  
  Directory: \\bts13r2b\tnsnames
  
  
  Mode                LastWriteTime     Length Name                                                                      
  ----                -------------     ------ ----                                                                      
  -a---          3/8/2017   9:51 AM      15991 tnsnames.ora 
  
  get-item \\bts13r2b\tnsnames
  
  Directory: 
  
  
  Mode                LastWriteTime     Length Name                                                                      
  ----                -------------     ------ ----                                                                      
  d----         3/21/2017  11:14 AM            tnsnames   
  </code></pre>
  
  <p>Tried using xcopy:</p>
  
  <pre><code>xcopy \\idmststtrm2\tns_admin$\tnsnames.ora \\bts13r2b\tnsnames\tnsnames.ora
  
  Access is denied.
  </code></pre>