Getting information from a Windows machine using the net command on Linux.

The net command may be used to get information from a Windows PC. Below is an example. I am reading the time from a Windows 7 Ultimate PC.

[email protected]:/home/homer# net time -I
Fri Jul 11 11:22:32 2014

This command shows the network shares that my Windows 7 Ultimate installation has, I am connected to the shares on my Debian PC.

[email protected]:/home/homer# smbtree -S
Enter root's password:
\\READYSHARE readyshare
\\DEBIAN debian server

Here is how to change a remote Windows PC password using Samba.

[email protected]:/home/homer# smbpasswd -U homer -r
Old SMB password:
New SMB password:
Retype new SMB password:
Password changed for user homer on

This is a good way to reset a Windows password if you cannot actually get to the machine; but you have network access.

The command below shows how to download a file from a fileshare on a Windows machine using Samba.

[email protected]:/home/homer# smbget smb://homer-PC/users/homer/Desktop/net.txt
Username for users at homer-PC [guest] homer
Password for users at homer-PC:
Using workgroup BIGRIGS, user homer
Downloaded 235b in 7 seconds

This is a very interesting trick indeed. Allowing you to download a file without using a GUI.

No comments have been made. Use this form to start the conversation :)

Leave a Reply