Exit codes of smbclient

六月ゝ 毕业季﹏ 提交于 2019-12-05 12:30:38
Timda

What would be best is to use the -E argument to smbclient and redirect 2>/errorlog from the command line. You can then check this file to see if any errors occurred.

Warning, the first line is always the Domain=......... so you may need to strip that line out.

Something like this:

smbclient Hostname -A authfile -E 1>log 2>errorlog <<-EOF 
get foo 
EOF

In the errorlog you should find something like below, your log file will be empty

Domain=[Hostname] OS=[Windows Server 2008 R2 Standard 7601 Service Pack 1] Server=[Windows Server 2008 R2 Standard 6.1] NT_STATUS_OBJECT_NAME_NOT_FOUND opening remote file \foo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!