Use PowerShell to enumerate Linux SMB shares
-
19-09-2019 - |
Question
I can list my own computer's shares no problem with:
gwmi Win32_Share
But when I try
gwmi Win32_Share -computer myserver
Where myserver
is an HP MediaVault mv2120 running BusyBox. I get back the response: Get-WmiObject : The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
Is there any way to get this done?
Solution
The "W" in WMI stands for "Windows," and while SAMBA does a half-decent job at getting server message block (SMB) working, it does not implement WMI on Linux. Not the same interface/protocol unfortunately.
If you want to view SAMBA shares from windows, use NET VIEW \\1.2.3.4 where 1.2.3.4 is the IP of your Unix box.
OTHER TIPS
No.. There is a wmiclient package available for Linux. Using that we can communicate Windows from Linux.
The RPC server is unavailable: We have to start RPC related services and WMI service in Windows machine.
The answer is NO - Linux does not have a WMI service.
Get-WMIObject only works against Windows systems (until someone in the Linux community implements WMI!)