使用 PowerShell 枚举 Linux SMB 共享

jas*_*onh 3 powershell wmi smb

我可以列出我自己电脑的共享,没有问题:

gwmi Win32_Share
Run Code Online (Sandbox Code Playgroud)

但是当我尝试

gwmi Win32_Share -computer myserver
Run Code Online (Sandbox Code Playgroud)

myserver运行 BusyBox 的 HP MediaVault mv2120在哪里。我得到回复:Get-WmiObject : The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)

有什么办法可以做到这一点吗?

x0n*_*x0n 5

WMI 中的“W”代表“Windows”,虽然 SAMBA 在使服务器消息块 (SMB) 工作方面做得还不错,但它并没有在 Linux 上实现 WMI。不幸的是,接口/协议不一样。

如果您想从 Windows 查看 SAMBA 共享,请使用 NET VIEW \\1.2.3.4,其中 1.2.3.4 是您的 Unix 机器的 IP。