Remotely Reboot Windows with a VBS script

|==========================================================================
|
| COMMENT: Remotely reboots a PC.  May use machine name or IP address.
|
|==========================================================================

On Error Resume Next
mname = InputBox("Enter Machine Name", "Reboot Machine")
If Len(mname) = 0 Then Wscript.Quit

if Msgbox("Are you sure you want to reboot machine " & mname, vbYesNo, "Reboot Machine") = vbYes then

Set OpSysSet = GetObject("winmgmts:{impersonationLevel=impersonate,(RemoteShutdown)}//" & mname).ExecQuery("select * from Win32_OperatingSystem where Primary=true")
for each OpSys in OpSysSet
OpSys.Reboot()
next
end if
Advertisements

Remotely Reboot Windows with VBS

|==========================================================================
|
| COMMENT: Remotely reboots a PC.  May use machine name or IP address.
|
|==========================================================================

On Error Resume Next
mname = InputBox("Enter Machine Name", "Reboot Machine")
If Len(mname) = 0 Then Wscript.Quit

if Msgbox("Are you sure you want to reboot machine " & mname, vbYesNo, "Reboot Machine") = vbYes then

Set OpSysSet = GetObject("winmgmts:{impersonationLevel=impersonate,(RemoteShutdown)}//" & mname).ExecQuery("select * from Win32_OperatingSystem where Primary=true")
for each OpSys in OpSysSet
OpSys.Reboot()
next
end if

Setting time on Windows XP via NTP

Windows XP has a built-in timesynchronization feature that’s designed to automaticallysynchronize your computer’s clock with an Internet time server on aregular basis. To access this feature, double-click the clock inthe notification area of the taskbar. From the Date And TimeProperties dialog box, select Internet Time. Make sure that theAutomatically Synchronize With An Internet Time Server check box isselected.

The Server drop-down list contains two timeservers: Microsoft’s time server at time.windows.com and the U.S.government’s atomic clock at time.nist.gov.

While you can manually type the name of anytime server that uses the Simple Network Time Protocol (SNTP) inthe Server text box, it’s more convenient to add time servers tothe list. However, this feature is available only onstand-alone Windows XP systems or systems that are a part of aworkgroup; it is not available on Windows XP Professional systemsthat are a part of a domain. Here’s how to add time servers:

  1. Launch the Registry Editor (Regedit.exe).
  2. Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Current
    Version\DateTime\Servers.
  3. Right-click the Servers key, and select New | String value.
  4. Name the value 3, and press [Enter] twice to access the Edit StringValue dialog box.
  5. Type the address of the SNTP time server in the Value Data textbox, and click OK.
  6. Repeat Steps 3 through 5 for each additional SNTP time server youwant to add, incrementing the value name each time: 4, 5, 6, and soon.
  7. Close the Registry Editor.

For a list of acceptable SNTP time servers, see Microsoft Knowledge Base article Q262680.

Outlook crashes when printing

Outlook keeps its printing style settings in a file called OutlPrnt. You can run into several issues like these hangs and crashes when the file gets corrupted. On multiple occasions I’ve also seen messages been printed in right-to-left format instead of left-to-right due to OutlPrnt corruptions.

You can recover from this by renaming the OutlPrnt file to .old when Outlook is closed. You can find the file here;
Windows Vista and Windows 7

C:\Users\%username%\AppData\Roaming\Microsoft\Outlook\

Windows XP

C:\Documents and Settings\%username%\Application Data\Microsoft\Outlook\

Installing Microsoft Exchange Tools on Windows XP

To start out, you will need the Microsoft Exchange 2003 CD or a network location with it installed

  • On your Windows XP system, go to the your Exchange 2003 CD or network location and run the setup located
  • <drive>: \setup\i386\setup.exe
  • Once it loads on the Component Selection page, do the following:
  • Under Component Name, locate Microsoft Exchange. In the corresponding Action column, select Custom.
  • Under Component Name, locate Microsoft Exchange System Management Tools. In the corresponding Action column, select Install(see figure below).
    Microsoft Exchange System Management Tools installation option

  • Click Next.
  • The rest is just hitting next or install until your finished.

.

Remotely Reboot Windows with a VBS script

|==========================================================================
|
| COMMENT: Remotely reboots a PC.  May use machine name or IP address.
|
|==========================================================================

On Error Resume Next
mname = InputBox("Enter Machine Name", "Reboot Machine")
If Len(mname) = 0 Then Wscript.Quit

if Msgbox("Are you sure you want to reboot machine " & mname, vbYesNo, "Reboot Machine") = vbYes then

Set OpSysSet = GetObject("winmgmts:{impersonationLevel=impersonate,(RemoteShutdown)}//" & mname).ExecQuery("select * from Win32_OperatingSystem where Primary=true")
for each OpSys in OpSysSet
OpSys.Reboot()
next
end if