Asked by:
How to resolve net : System error 67 has occurred.

Question
-
My following code is giving net : System error 67 has occurred.
$dbServer = "192.164.2.14"
$username = "jmallick"
$password = "Password@3"
net use $dbServer $password /USER:$username
Get-ChildItem F:\goldenCopy | Where-Object {$_.mode -match "d"}When I run this code it is giving me
PS SQLSERVER:\> D:\Eclipse_Repository\localtest\remote.ps1
net : System error 67 has occurred.
At D:\Eclipse_Repository\localtest\remote.ps1:6 char:1
+ net use $uncServer $password /USER:$username
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (System error 67 has occurred.:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandErrorDid some googling but not helping me. Any thoughts on this ?
Monday, July 2, 2018 9:04 AM
All replies
-
I am able to access the host machine from mstsc with the same credentialMonday, July 2, 2018 9:12 AM
-
Hi!
Looks like you are missing some things in your syntax, refer to the net use /? for more information.
Are you trying to map a share on the dbServer?Example:
NET USE [driveletter:] \\$dbServer\ShareNameBest regards,
LeonBlog:
https://thesystemcenterblog.com LinkedIn:
- Proposed as answer by jrv Monday, July 2, 2018 9:21 AM
Monday, July 2, 2018 9:17 AM -
Not exactly on db server I want to copy few files from One folder to another folder on the same server as above. The dbserver is a notationMonday, July 2, 2018 12:41 PM
-
You cannot remotely map a drive.
\_(ツ)_/
Monday, July 2, 2018 12:57 PM -
Only if you want to copy paste remotely then try copy item.
Copy-Item -Path \\servera\test -Destination \\servera\testb
For more Info https://blogs.msdn.microsoft.com/luisdem/2016/08/31/powershell-how-to-copy-a-local-file-to-remote-machines/
- Edited by Partha1012 Monday, July 2, 2018 1:17 PM
Monday, July 2, 2018 1:16 PM -
What if you give it a try to my script
https://gallery.technet.microsoft.com/scriptcenter/Copy-Files-from-folderA-to-29710ef9
Just tested and it worked like a charm, btw, the destination folder didn't exist so the script created it.
- Proposed as answer by j0rt3g4 Monday, July 2, 2018 4:52 PM
Monday, July 2, 2018 4:52 PM