Skip to main content
Home
badllama.com
  • Search
  • Log In

Windows

Thu, 04/07/2011 - 00:08 by bchavet

Force machine to look for available Windows Updates

wuauclt.exe /detectnow /resetauthorization /reportnow /updatenow

Mount a network share to a drive

net use X: \\server\sharename

View RDP sessions of a remote server

net use \\1.2.3.4\ipc$
qwinsta /server:1.2.3.4

Force logoff of remote user

where "1" is the ID the session id from qwinsta above (also works to "unstick" a console session sometimes)

rwinsta 1 /server:1.2.3.4

Check Uptime

net statistics server

Remove Service

net stop "Service Name"
sc delete "Service Name"

View all network shares with their paths on a local machine

net share

Reset Network Interface

netsh interface set interface "local area connection" disabled & netsh interface set interface "local area connection" enabled

Recover Administrator Password

From http://4sysops.com/archives/forgot-the-administrator-password-the-sticky...

  1. Boot from Windows PE or Windows RE and access the command prompt.
  2. Find the drive letter of the partition where Windows is installed. In Vista and Windows XP, it is usually C:, in Windows 7, it is D: in most cases because the first partition contains Startup Repair. To find the drive letter, type C: (or D:, respectively) and search for the Windows folder. Note that Windows PE (RE) usually resides on X:.
  3. Type the following command (replace “c:” with the correct drive letter if Windows is not located on C:):
    copy c:\windows\system32\sethc.exe c:\

    This creates a copy of sethc.exe to restore later.

  4. Type this command to replace sethc.exe with cmd.exe:
    copy /y c:\windows\system32\cmd.exe c:\windows\system32\sethc.exe
  5. Reboot your computer and start the Windows installation where you forgot the administrator password.
  6. After you see the logon screen, press the SHIFT key five times.
  7. You should see a command prompt where you can enter the following command to reset the Windows password (see screenshot above):
    net user you_user_name new_password

    If you don’t know your user name, just type net user to list the available user names.

  8. You can now log on with the new password.

I recommend that you replace sethc.exe with the copy you stored in the root folder of your system drive in step 3. For this, you have to boot up again with Windows PE or RE because you can’t replace system files while the Windows installation is online. Then you have to enter this command:

copy /y c:\sethc.exe c:\windows\system32\sethc.exe

List Available Perfmon Counters

typeperf -qx

Remotely reboot a machine

net use \\[host]\IPC$ [password] /user:[local administrator]
shutdown /r /m \\[host]

Can't browse all machines on a network

In server 2008 R2, the 'computer browser' service is disabled by default. If you enable this service on your WINS server, all your client machines should be able to browse the network.

Powered by Backdrop CMS