Closed azamsolix closed 3 years ago
a samba share consists of the host and the sharename. share attribute should be of the form \\\\hostname\\sharename
Thank you ! Just an confirmation sharename is nothing but path,right?
no, there is a share and inside it there are paths. you connect to a share, once connected you can access to its root path \
Thank you so much for your help @vdiez Could you please help me with some sample code how can i access root path? Thanks Azam
you have code examples in the main README of the package:
// load the library
var SMB2 = require('@marsaud/smb2');
// create an SMB2 instance
var smb2Client = new SMB2({
share: '\\\\000.000.000.000\\c$',
domain: 'DOMAIN',
username: 'username',
password: 'password!',
});
read contents from root dir:
smb2Client.readdir('\\', function(err, files) {
if (err) throw err;
console.log(files);
});
Yes,I understood. My question is how i can get rootpath? Thanks Azam
what do you mean by rootpath? the root path of the share is always \
Hi, I am getting error after providing all the credentials
Error: STATUS_LOGON_FAILURE (0xC000006D) : The attempted logon is invalid. This is either due to a bad username or authentication information.
at SMB2Forge.request (E:\REST-API-with-Nodejs\Back end\node_modules\@marsaud\smb2\lib\tools\smb2-forge.js:22:15)
at E:\REST-API-with-Nodejs\Back end\node_modules\@marsaud\smb2\lib\tools\smb2-connection.js:114:11
at Object.
I checked smbclient object and found out connected property is false.But,I am providing all the details correct. Could you please help me with this? Thanks Azam
// create an SMB2 instance var smb2Client = new SMB2({ share: '\\10.2.153.109', domain: 'Domain', username: 'abcb2', password: '**!', }); I am getting error stating the share is not valid
What is mean by share? Could you please help me with this?