<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Computer Support &#187; System configuration</title>
	<atom:link href="http://www.xiitec.com/blog/category/system-administration/windows/system-configuration/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.xiitec.com/blog</link>
	<description></description>
	<lastBuildDate>Wed, 30 Dec 2009 08:40:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Restarting or Shutting Down a Server</title>
		<link>http://www.xiitec.com/blog/2008/02/20/restarting-or-shutting-down-a-server/</link>
		<comments>http://www.xiitec.com/blog/2008/02/20/restarting-or-shutting-down-a-server/#comments</comments>
		<pubDate>Wed, 20 Feb 2008 21:51:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[System configuration]]></category>
		<category><![CDATA[restart]]></category>
		<category><![CDATA[shutdown]]></category>

		<guid isPermaLink="false">http://www.xiitec.com/blog/?p=156</guid>
		<description><![CDATA[When you shut down or restart a Windows server, a signal is sent to all devices, services, and programs running on the system. This signal announces that the system is preparing to shut down so everything needs to close gracefully, if possible. A normal shutdown will wait for a response from all devices and processes [...]]]></description>
			<content:encoded><![CDATA[<p>When you shut down or restart a Windows server, a signal is sent to all devices, services, and programs running on the system. This signal announces that the system is preparing to shut down so everything needs to close gracefully, if possible. A normal shutdown will wait for a response from all devices and processes to make sure they have saved any files and can close before proceeding with the shutdown. If you&#8217;ve ever had Notepad or Word open with an unsaved file, you&#8217;ve seen the message asking if you want to save the file before the application closes.</p>
<p><span id="more-156"></span></p>
<p>If you need to automate the shutdown or restart of a system, then politely asking each application to close can be problematic. If someone had an open unsaved file on the target system, the shutdown wouldn&#8217;t proceed as expected. That&#8217;s why Windows also supports forcefully shutting down a system. With the shutdown.exe command, you can specify an additional option (/f on Windows Server 2003 and /c on Windows 2000) to force all applications to close. If an application like Notepad is running, it automatically closes any unsaved files and your unsaved changes will be lost.</p>
<p>On the programmatic side, the Win32_OperatingSystem class supports two shutdown methods. The first one (Shutdown), performs a normal shutdown. It will not forcefully close files. The second, however, Win32Shutdown, will.</p>
<p>So you can perform a forceful shutdown with a command line and from a script. How about from the GUI? You sure can. Just hit Ctrl+Alt+Del on your keyboard. Using the Tab key move to the Shut Down button. Hold the Ctrl key down and click Enter. Click OK to confirm the shutdown.</p>
<p>One other thing that you may need to do at some point is schedule a server to reboot or shutdown at a specific time. This is sometimes needed if an entire network or data center needs to move or go down for maintenance. You could automate this job pretty quickly using a combination of the scripting solutions and the Task Scheduler, but there is another way using the command line. The at.exe command lets you schedule a task to run either locally or remotely at a specified time.</p>
<p>This command causes a server to shut down at 20:00 (8 P.M.) tonight:</p>
<pre>&gt; at \\<servername> 20:00 shutdown.exe /s /c "Datacenter move"</servername></pre>
<p>This command causes the server to restart at 21:00 (9 P.M.) every Friday night:</p>
<pre>&gt; at \\<servername> 21:00 /every:F shutdown.exe /r /c "Weekly restart"</servername></pre>
<pre><servername></servername></pre>
<p><servername><strong> Using a graphical user interface</strong></servername></p>
<p><servername>With Windows Server 2003 and Windows 2000 you can obviously shut a machine down by going to Start  &gt; Shut Down, but I&#8217;ll describe the new graphical interface with the shutdown.exe command, which is available in Windows Server 2003.</servername></p>
<ol>
<li>From the Start menu select Run.</li>
<li>Type cmd.exe and click OK.</li>
<li>In the CMD window, type shutdown /i and hit enter.</li>
<li>Click the Add button, type the names of the server(s) you want to shut down or restart, and click OK.</li>
<li>Select whether you want to restart or shut down the server(s).</li>
<li>Enter the number of seconds to warn logged on users (or uncheck to not warn).</li>
<li>Configure the Shutdown Event Tracker options.</li>
<li>Click OK. In the CMD window, you&#8217;ll see a status message stating if the operation was successful.</li>
</ol>
<p>Here is another option that is available from either Windows 2000 or Windows Server 2003:</p>
<ol>
<li>Open the Computer Management snap-in.</li>
<li>If you want to target a remote system, right-click on the Computer Management icon in the left pane and select Connect to another computer. Enter the computer name beside Another computer and click OK.</li>
<li>Right-click on the Computer Management icon in the left pane and select Properties.</li>
<li>Click the Advanced tab.</li>
<li>Under Startup and recovery, click the Settings button.</li>
<li>Click the Shut Down button.</li>
<li>Select from the list of actions and options under Forced Closed Apps.</li>
<li>Click OK.</li>
</ol>
<p><strong>Using a command-line interface</strong></p>
<p>The following two commands work with the Windows Server 2003 version of shutdown.exe. This shuts a server down after the 30 seconds (default wait timer):</p>
<pre>&gt; shutdown /m \\<servername> /s /c "Server requires reboot due to app install"</servername></pre>
<p>This command restarts a server after 20 seconds:</p>
<pre>&gt; shutdown /m \\<servername> /r /t 20 /c "Server is going down for repairs"</servername></pre>
<p>You can use the /f option to force applications to close.</p>
<p>On Windows 2000, the shutdown options are a little different. This command shuts down a server (in 30 seconds by default):</p>
<pre>&gt; shutdown \\<servername> "Server is going down for repairs"</servername></pre>
<p>And this restarts (/r option) a server in 15 seconds:</p>
<pre>&gt; shutdown \\<servername> /r /t:15 "Server requires reboot due to app install"</servername></pre>
<p>You can force all applications to close by using the /c option.</p>
<p><strong>Using VBScript</strong></p>
<pre>' This code shuts a server down.
 ' ------ SCRIPT CONFIGURATION ------
 strComputer = "<servername>"   ' e.g., rallen-srv01
 ' ------ END CONFIGURATION ---------
 set objWMI = GetObject("winmgmts:\\" &amp; strComputer &amp; "\root\cimv2")
 set colOS = objWMI.InstancesOf("Win32_OperatingSystem")
 for each objOS in colOS
    intRC = ObjOS.Shutdown( )
    if intRC &lt;&gt; 0 then
       WScript.Echo "Error attempting to shutdown server: " &amp; intRC
    else
       WScript.Echo "Shutting down server..."
    end if
 next</servername></pre>
<pre>' This code forcefully shuts a server down.
 ' ------ SCRIPT CONFIGURATION ------
 strComputer = "<servername>"   ' e.g., rallen-srv01
 intFlag = 1 + 4    ' Flag for forceful shut down
 ' ------ END CONFIGURATION ---------
 set objWMI = GetObject("winmgmts:\\" &amp; strComputer &amp; "\root\cimv2")
 set colOS = objWMI.InstancesOf("Win32_OperatingSystem")
 for each objOS in colOS
    intRC = ObjOS.Win32Shutdown(intFlag)
    if intRC &lt;&gt; 0 then
       WScript.Echo "Error attempting to shutdown server: " &amp; intRC
    else
       WScript.Echo "Shutting down server..."
    end if
 next</servername></pre>
<pre>' This code reboots a server.
 ' ------ SCRIPT CONFIGURATION ------
 strComputer = "<servername>"   ' e.g. rallen-srv01
 ' ------ END CONFIGURATION ---------
 set objWMI = GetObject("winmgmts:\\" &amp; strComputer &amp; "\root\cimv2")
 set colOS = objWMI.InstancesOf("Win32_OperatingSystem")
 for each objOS in colOS
    intRC = ObjOS.Reboot( )
    if intRC &lt;&gt; 0 then
       WScript.Echo "Error attempting to reboot server: " &amp; intRC
    else
       WScript.Echo "Rebooting server..."
    end if
 next</servername></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.xiitec.com/blog/2008/02/20/restarting-or-shutting-down-a-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disabling Shutdown Tracker</title>
		<link>http://www.xiitec.com/blog/2008/02/20/disabling-shutdown-tracker/</link>
		<comments>http://www.xiitec.com/blog/2008/02/20/disabling-shutdown-tracker/#comments</comments>
		<pubDate>Wed, 20 Feb 2008 21:46:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[System configuration]]></category>
		<category><![CDATA[disable]]></category>

		<guid isPermaLink="false">http://www.xiitec.com/blog/?p=155</guid>
		<description><![CDATA[You want to disable the Shutdown Tracker from running at system startup on lab or test systems because it is annoying. Shutdown Tracker is a new feature of Windows Server 2003 that prompts you to provide a description of the reason why a server is being shut down or restarted. If the server unexpectedly restarted, [...]]]></description>
			<content:encoded><![CDATA[<p>You want to disable the Shutdown Tracker from running at system startup on lab or test systems because it is annoying. Shutdown Tracker is a new feature of Windows Server 2003 that prompts you to provide a description of the reason why a server is being shut down or restarted. If the server unexpectedly restarted, you are prompted during logon for this information.</p>
<p><span id="more-155"></span></p>
<p>You need to reboot the system for the changes to take effect after performing one of the following.</p>
<p><strong>Using a graphical user interface</strong></p>
<ol>
<li>Open the Registry Editor (regedit.exe) and connect to the target machine.</li>
<li>In the left pane, expand HKEY_LOCAL_MACHINE  &gt; SOFTWARE  &gt; Policies  &gt; Microsoft  &gt; Windows NT.</li>
<li>If there is no subkey called Reliability, create it by right-clicking Windows NT, selecting New  Key, and typing Reliability.</li>
<li>Right-click Reliability and select New  &gt; DWORD Value.</li>
<li>In the right pane, type ShutdownReasonOn and hit enter. Leave the default value set to 0.</li>
</ol>
<p>You can also disable Shutdown Tracker using group policy. The settings for it are located in Computer Configuration  &gt; Administrative Templates  &gt; System  &gt; Display Shutdown System Tracker.</p>
<p><strong>Using a command-line interface</strong><br />
The following command disables the Shutdown Tracker:</p>
<pre>&gt; reg add "\\<servername>\HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Reliability" /v
 ShutdownReasonOn /t REG_DWORD /d 0</servername></pre>
<p><strong>Using VBScript</strong></p>
<pre>' This code disables the Shutdown Tracker from running.
 ' ------ SCRIPT CONFIGURATION ------
 intEnable = 0      ' 0 = disable; 1 = enable screen
 strComputer = "."  ' e.g., rallen-srv01
 ' ------ END CONFIGURATION ---------
 const HKLM = &amp;H80000002
 strKeyPath = "SOFTWARE\Policies\Microsoft\Windows NT\Reliability"
 set objReg = GetObject("winmgmts:\\" &amp; strComputer &amp; _
                        "\root\default:StdRegProv")
 intRC1 = objReg.CreateKey(HKLM,strKeyPath)
 intRC2 = objReg.SetDwordValue(HKLM, strKeyPath, "ShutdownReasonOn", intEnable)
 if intRC1 &lt;&gt; 0 or intRC2 &lt;&gt; 0 then
    WScript.Echo "Error setting registry value: " &amp; intRC
 else
    WScript.Echo "Successfully disabled shutdown tracker"
 end if</pre>
<p>Don&#8217;t get me wrong, I think the Shutdown Tracker is a very useful feature. In fact, I&#8217;m glad Microsoft added it, but it can be annoying on test systems that you want to restart or shut down frequently. After Shutdown Tracker runs, it creates event 1074 in the System event log. Here is an example:</p>
<pre>Event Type:    Information
 Event Source:    USER32
 Event Category:    None
 Event ID:    1074
 Date:        10/11/2003
 Time:        6:50:42 PM
 User:        rallen-w2k3\administrator
 Computer:    RALLEN-W2K3
 Description:
 The process Explorer.EXE has initiated the restart of computer RALLEN-W2K3 on behalf
 of user RALLEN-W2K3\Administrator for the following reason: Other (Planned)
  Reason Code: 0x85000000
  Shutdown Type: restart
  Comment: Just installed a hotfix.</pre>
<pre>For more information, see Help and Support Center at http://go.microsoft.com/fwlink/
 events.asp.
 Data:
 0000: 00 00 00 85               ...</pre>
<p>You can even customize Shutdown Tracker if you want. You can create your own shutdown reasons. There are eight by default. All it takes is some more registry changes. See MS KB 293814 for more information.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xiitec.com/blog/2008/02/20/disabling-shutdown-tracker/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disabling the Manage/Configure Your Server Screen</title>
		<link>http://www.xiitec.com/blog/2008/02/20/disabling-the-manageconfigure-your-server-screen/</link>
		<comments>http://www.xiitec.com/blog/2008/02/20/disabling-the-manageconfigure-your-server-screen/#comments</comments>
		<pubDate>Wed, 20 Feb 2008 21:42:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[System configuration]]></category>
		<category><![CDATA[disable]]></category>

		<guid isPermaLink="false">http://www.xiitec.com/blog/?p=154</guid>
		<description><![CDATA[When you log into a Windows 2000 Server or Windows Server 2003 system for the first time, the Configure Your Server or Manage Your Server screens, respectively, are displayed. These screens are intended to make managing a server easier by providing links to install services and obtain help information. These screens are displayed for every [...]]]></description>
			<content:encoded><![CDATA[<p>When you log into a Windows 2000 Server or Windows Server 2003 system for the first time, the Configure Your Server or Manage Your Server screens, respectively, are displayed. These screens are intended to make managing a server easier by providing links to install services and obtain help information. These screens are displayed for every user that logs on until the user checks the box on the screen to stop the screen from running at logon.</p>
<p><span id="more-154"></span></p>
<p>A setting in the registry controls whether this screen is displayed by default. When a user logs on for the first time, the subkeys and values in the HKEY_USERS\.DEFAULT key are copied to HKEY_USERS\<username>, which is the same as HKEY_CURRENT_USER for the currently logged on user. Under the .DEFAULT key, the Software\Microsoft\Windows NT\CurrentVersion\srvWiz value dictates if the Configure/Manage Your Server screen displays at logon. A value of 0 disables the screen from displaying and 1 enables it. If you set it to 0 before any user logs on to the system, that screen will never display.</username></p>
<p><strong>Using a graphical user interface</strong></p>
<p>The following directions disable the screen for the currently logged on user only. See the command-line solution for how to disable it for all users by default.</p>
<p>For Windows Server 2003:</p>
<ol>
<li>From the Start menu, select All Programs  Administrative Tools  Manage Your Server.</li>
<li>At the bottom lefthand corner of the screen, check the box beside Don&#8217;t display this page at logon.</li>
</ol>
<p>For Windows 2000:</p>
<ol>
<li>From the Start menu, select Programs  Administrative Tools  Configure Your Server.</li>
<li>At the bottom of the screen, uncheck the box beside Show this screen at startup.</li>
</ol>
<p><strong>Using a command-line interface</strong></p>
<p>Run the following command against a Windows Server 2003 or Windows 2000 machine to prevent the Manage/Configure Your Server screen from displaying for all users:</p>
<pre>&gt; reg add "\\<servername>\HKU\.DEFAULT\Software\Microsoft\Windows NT\CurrentVersion\
 Setup\Welcome" /v srvwiz /t REG_DWORD /d 0</servername></pre>
<p>If a user logged in before you set the previous registry value, then you&#8217;ll need to run this command to disable it for the logged-in user (note: this command must be run locally):</p>
<pre>&gt; reg add "HKCU\Software\Microsoft\Windows NT\CurrentVersion\Setup\Welcome\srvWiz"
 /ve /t REG_DWORD /d 0</pre>
<p><strong>Using VBScript</strong></p>
<pre>' This code disables the
  Manage/Configure Your Server screen for all users
 ' (this only applies to users that have not logged in yet)
 ' ------ SCRIPT CONFIGURATION ------
 intEnable = 0                 ' 0 = disable screen; 1 = enable screen
 strComputer = "<servername>"  ' name of target server
 ' ------ END CONFIGURATION ---------
 const HKU   = &amp;H80000003
 strKeyPath  = ".DEFAULT\Software\Microsoft\Windows NT\CurrentVersion\" &amp; _
               "Setup\Welcome"
 strValue = "srvwiz"
 set objReg = GetObject("winmgmts:\\" &amp; strComputer &amp; _
                        "\root\default:StdRegProv")
 intRC = objReg.SetDwordValue(HKU, strKeyPath, strValue, intEnable)
 if intRC &lt;&gt; 0 then
    WScript.Echo "Error setting registry value: " &amp; intRC
 else
    WScript.Echo "Successfully disabled screen"
 end if</servername></pre>
<pre>' This code disables the Manage/Configure Your Server screen for
 ' the currently logged on user.
 ' ------ SCRIPT CONFIGURATION ------
 intEnable = 0   ' 0 = disable screen; 1 = enable screen
 strComputer = "."
 ' ------ END CONFIGURATION ---------
 const HKCU   = &amp;H80000001
 strKeyPath   = "Software\Microsoft\Windows NT\CurrentVersion\" &amp; _
               "Setup\Welcome\srvWiz"
 set objReg = GetObject("winmgmts:\\" &amp; strComputer &amp; _
                        "\root\default:StdRegProv")
 intRC = objReg.SetDwordValue(HKCU, strKeyPath, "", intEnable)
 if intRC &lt;&gt; 0 then
    WScript.Echo "Error setting registry value: " &amp; intRC
 else
    WScript.Echo "Successfully disabled screen"
 end if</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.xiitec.com/blog/2008/02/20/disabling-the-manageconfigure-your-server-screen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Viewing System Uptime</title>
		<link>http://www.xiitec.com/blog/2008/02/20/viewing-system-uptime/</link>
		<comments>http://www.xiitec.com/blog/2008/02/20/viewing-system-uptime/#comments</comments>
		<pubDate>Wed, 20 Feb 2008 21:37:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[System configuration]]></category>
		<category><![CDATA[system uptime]]></category>

		<guid isPermaLink="false">http://www.xiitec.com/blog/?p=153</guid>
		<description><![CDATA[In the early days of Windows NT 3.51 and 4.0, it wasn&#8217;t uncommon for servers to reboot or need to be rebooted on a regular basis. Applications were not as well behaved as they are today and the operating system wasn&#8217;t as stable. This changed with Windows 2000, when unexpected failures became much less common. [...]]]></description>
			<content:encoded><![CDATA[<p>In the early days of Windows NT 3.51 and 4.0, it wasn&#8217;t uncommon for servers to reboot or need to be rebooted on a regular basis. Applications were not as well behaved as they are today and the operating system wasn&#8217;t as stable. This changed with Windows 2000, when unexpected failures became much less common. But there were still a lot of hotfixes and patches to install on a regular basis, most of which required reboots. Hopefully Windows Server 2003 will continue the upward trend in availability and further reduce the number of reboots that are required.</p>
<p><span id="more-153"></span></p>
<p>It is a good idea to pay attention to the uptime on your servers to make sure their availability jives with what you think it should be. Perhaps a server rebooted due to a blue screen or even worse, because another administrator (or attacker!) did something they shouldn&#8217;t have. Looking at system uptime is the poor man&#8217;s availability monitor. You may even want to create a script that runs at system startup on your servers, which can serve as a notification mechanism anytime your servers reboot.</p>
<p><strong>Using a command-line interface</strong></p>
<p>All three of the following commands display the system uptime:</p>
<pre>&gt; psinfo \\<servername> | findstr Uptime
 &gt; srvinfo \\<servername> | findstr /c:"Up Time"
 &gt; systeminfo /s <servername> | findstr /c:"Up Time"</servername></servername></servername></pre>
<p><strong>Using VBScript</strong></p>
<pre>' This code prints system uptime for a host.
 ' ------ SCRIPT CONFIGURATION ------
 strComputer = "."   ' e.g., rallen-srv01
 ' ------ END CONFIGURATION ---------
 set objWMIDateTime = CreateObject("WbemScripting.SWbemDateTime")
 set objWMI = GetObject("winmgmts:\\" &amp; strComputer &amp; "\root\cimv2")
 set colOS = objWMI.InstancesOf("Win32_OperatingSystem")
 for each objOS in colOS
    objWMIDateTime.Value = objOS.LastBootUpTime
    Wscript.Echo "System Up Time: " &amp; objWMIDateTime.GetVarDate
 next</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.xiitec.com/blog/2008/02/20/viewing-system-uptime/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuring System Failure Options</title>
		<link>http://www.xiitec.com/blog/2008/02/20/configuring-system-failure-options/</link>
		<comments>http://www.xiitec.com/blog/2008/02/20/configuring-system-failure-options/#comments</comments>
		<pubDate>Wed, 20 Feb 2008 21:34:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[System configuration]]></category>
		<category><![CDATA[failure]]></category>

		<guid isPermaLink="false">http://www.xiitec.com/blog/?p=152</guid>
		<description><![CDATA[Microsoft operating systems have had a reputation for frequent  crashes, which can cause the system to freeze and become unusable until  it is rebooted. A crash is sometimes referred to as a system failure,  bug check, stop error, or blue screen of death (for the blue screen  that is displayed after [...]]]></description>
			<content:encoded><![CDATA[<p>Microsoft operating systems have had a reputation for frequent  crashes, which can cause the system to freeze and become unusable until  it is rebooted. A crash is sometimes referred to as a system failure,  bug check, stop error, or blue screen of death (for the blue screen  that is displayed after the crash). System failures were especially  common in the days of Windows 3.51 and Windows 9x. Fortunately,  Microsoft has steadily improved in this area and now Windows 2000 and  Windows Server 2003 are two of the most stable operating systems  available. Nevertheless, Microsoft hasn&#8217;t been able to completely rid  itself of occasional crashes due to bugs in the OS or bad third-party  drivers.</p>
<p><span id="more-152"></span>There are several settings you can configure to control what happens  after a system crash. By default, when a system crashes, it writes the  contents of memory to a debug file in the system root called  memory.dmp. This file will be one of the first things Microsoft asks  for if you open a support case about the crash (see MS KB 314103 for  more information). After the debug file is written, an event is written  to the System Event log and, if configured, an administrative alert is  sent to the administrator of the system. See MS KB 310490 for more on  configuring administrative alerts. Lastly, the system automatically  reboots. You may want to give some thought about this last option  because I&#8217;ve seen more than one case where a system continuously  reboots itself because it experienced the failure during system  startup. Also, if you automatically reboot and are not closely  monitoring your systems, there could be sporadic undetected crashes.</p>
<p><strong>Using a graphical user interface</strong></p>
<ol>
<li> From the Control Panel, open the System applet.</li>
<li>Select the Advanced tab.</li>
<li>Under Startup and Recovery, click the Settings button.</li>
<li>All of the system failure options are located under the System Failure heading. Modify the settings as necessary.</li>
<li>Click OK until all of the windows are closed.</li>
</ol>
<p><strong>Using a command-line interface</strong></p>
<p>The system failure and recovery options are stored in the registry.  You can view the current settings by enumerating the  HKLM\SYSTEM\CurrentControlSet\Control\CrashControl subkey:</p>
<pre>&gt; reg query \\\HKLM\SYSTEM\CurrentControlSet\Control\CrashControl</pre>
<p>On Windows Server 2003, you can also use the wmic utility to view these settings:</p>
<pre>&gt; wmic /node: recoveros list /format:list</pre>
<p>To modify these settings, use either the reg add command (on Windows  2000) or the wmic command (on Windows Server 2003). Next, I&#8217;ll show  some examples using wmic.</p>
<p>To disable admin alerts after failure, do the following:</p>
<pre>&gt; wmic recoveros set SendAdminAlert = False</pre>
<p>To disable automatic reboot after failure, do the following:</p>
<pre>&gt; wmic recoveros set AutoReboot = False</pre>
<p>To not write any information to a memory dump file after failure, do the following:</p>
<pre>&gt; wmic recoveros set DebugInfoType = 0</pre>
<p>To set the mini-dump directory to d:\minidumps (only available with Windows Server 2003), do the following:</p>
<pre>&gt; wmic recoveros set MiniDumpDirectory = d:\minidumps</pre>
<p>To set the location of the dump file to D:\Dump\Mem.dmp, do the following:</p>
<pre>&gt; wmic recoveros set DebugFilePath = D:\Dump\Mem.dmp</pre>
<p>To not overwrite an existing dump file, do the following:</p>
<pre>&gt; wmic recoveros set OverwriteExistingDebugFile = 0</pre>
<p><strong>Using VBScript</strong></p>
<pre>' This code displays the current failure and recovery settings.
 ' ------ SCRIPT CONFIGURATION ------
 strComputer = "."  ' e.g., rallen-srv01
 ' ------ END CONFIGURATION ---------
 set objWMI = GetObject("winmgmts:\\" &amp; strComputer &amp; "\root\cimv2")
 set colRecoveryConfig = objWMI.InstancesOf("Win32_OSRecoveryConfiguration")
 for each objConfig in colRecoveryConfig
     Wscript.Echo objConfig.Name
     Wscript.Echo "  Auto reboot: " &amp; objConfig.AutoReboot
     Wscript.Echo "  Debug File Path: " &amp; objConfig.DebugFilePath
     Wscript.Echo "  Debug Type: " &amp; objConfig.DebugInfoType
     Wscript.Echo "  Expanded Debug File Path: " &amp; objConfig.ExpandedDebugFilePath
     Wscript.Echo "  Kernel Dump Only: " &amp; objConfig.KernelDumpOnly
     Wscript.Echo "  Overwrite Existing: " &amp; objConfig.OverwriteExistingDebugFile
     Wscript.Echo "  Send Admin Alert: " &amp; objConfig.SendAdminAlert
     Wscript.Echo "  Write Debug Info: " &amp; objConfig.WriteDebugInfo
     Wscript.Echo "  Write to System Log: " &amp; objConfig.WriteToSystemLog
 next</pre>
<pre>' This code modifies the system failure and recovery settings.
 ' ------ SCRIPT CONFIGURATION ------
 strComputer = "."  ' e.g., rallen-srv01
 ' ------ END CONFIGURATION ---------
 set objWMI = GetObject("winmgmts:\\" &amp; strComputer &amp; "\root\cimv2")
 set colRecoveryConfig = objWMI.InstancesOf("Win32_OSRecoveryConfiguration")
 for each objConfig in colRecoveryConfig
     Wscript.Echo objConfig.Name</pre>
<pre>   ' Uncomment the settings you want to modify:
     ' objConfig.AutoReboot = True
     ' objConfig.DebugFilePath = "d:\dumps\memory.dmp"
     ' objConfig.DebugInfoType = 1  ' Only available on W2K3
     ' objConfig.KernelDumpOnly = False
     ' objConfig.MiniDumpDirectory = "d:\minidumps" ' Only available on W2K3
     ' objConfig.OverwriteExistingDebugFile = True
     ' objConfig.SendAdminAlert = True
     ' objConfig.WriteDebugInfo = True
     ' objConfig.WriteToSystemLog = True</pre>
<pre>    objConfig.Put_
 next
 WScript.Echo "Successfully modified settings."</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.xiitec.com/blog/2008/02/20/configuring-system-failure-options/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuring System Startup Options</title>
		<link>http://www.xiitec.com/blog/2008/02/20/configuring-system-startup-options/</link>
		<comments>http://www.xiitec.com/blog/2008/02/20/configuring-system-startup-options/#comments</comments>
		<pubDate>Wed, 20 Feb 2008 21:25:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[System configuration]]></category>
		<category><![CDATA[startup]]></category>

		<guid isPermaLink="false">http://www.xiitec.com/blog/?p=151</guid>
		<description><![CDATA[Using a graphical user interface

 From the Control Panel, open the System applet.
Select the Advanced tab.
Under Startup and Recovery, click the Settings button.
Under the System Startup heading, you can modify the default operating system and the amount of time the system waits before loading the default OS.
To change additional startup options on Windows Server 2003, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Using a graphical user interface</strong></p>
<ol>
<li> From the Control Panel, open the System applet.</li>
<li>Select the Advanced tab.</li>
<li>Under Startup and Recovery, click the Settings button.</li>
<li>Under the System Startup heading, you can modify the default operating system and the amount of time the system waits before loading the default OS.</li>
<li>To change additional startup options on Windows Server 2003, you can click the Edit button to modify the boot.ini file.</li>
<li>Click OK until all of the windows are closed.</li>
</ol>
<p><span id="more-151"></span><strong>Using a command-line interface</strong><br />
Windows Server 2003 includes a new tool called bootcfg.exe (also available with Windows XP) that lets you examine and modify the system startup options (including boot.ini) from the command line. To get a list of the current startup options, run bootcfg without any parameters:</p>
<pre>&gt; bootcfg</pre>
<p>The following command changes the timeout setting for the default OS option to 15 seconds:</p>
<pre>&gt; bootcfg /timeout 15</pre>
<p>The following command adds the /DEBUG and /SOS options to the OS option defined by ID 2 (which you can see by running bootcfg without any options):</p>
<pre>&gt; bootcfg /Raw "/DEBUG /SOS" /A /ID 2</pre>
<p>For the complete list of bootcfg options, run bootcfg /? from the command line.</p>
<p>The Edit button is available only on Windows Server 2003. If you want to modify the boot.ini file on Windows 2000, you&#8217;ll have to use the procedures described next in the command-line solution.</p>
<p>Since Windows 2000 doesn&#8217;t come with the bootcfg utility, you have to modify the boot.ini file directly. First, make the file editable:</p>
<pre>&gt; attrib %SystemDrive%\boot.ini -h -r -s</pre>
<p>Then edit the file:</p>
<pre>&gt; edit %SystemDrive%\boot.ini</pre>
<p>And finally, make the file read-only and hidden again:</p>
<pre>&gt; attrib %SystemDrive%\boot.ini +h +r +s</pre>
<p><strong>Using VBScript</strong></p>
<pre>' This code displays the system startup settings.</pre>
<pre>' ------ SCRIPT CONFIGURATION ------</pre>
<pre>strComputer = "."  ' e.g., rallen-srv01</pre>
<pre>' ------ END CONFIGURATION ---------</pre>
<pre>set objWMI = GetObject("winmgmts:\\" &amp; strComputer &amp; "\root\cimv2")</pre>
<pre>set colCompSys = objWMI.InstancesOf("Win32_ComputerSystem")</pre>
<pre>for Each objCompSys in colCompSys</pre>
<pre>    WScript.Echo "Startup Delay: " &amp; objCompSys.SystemStartupDelay</pre>
<pre>    for each strOption in objCompSys.SystemStartupOptions</pre>
<pre>       WScript.Echo "Operating System: " &amp; strOption</pre>
<pre>    next</pre>
<pre>next</pre>
<pre>' This code sets the startup delay to 10 seconds.
 ' ------ SCRIPT CONFIGURATION ------
 strComputer = "."  ' e.g., rallen-srv01
 ' ------ END CONFIGURATION ---------
 set objWMI = GetObject("winmgmts:\\" &amp; strComputer &amp; "\root\cimv2")
 set colCompSys = objWMI.InstancesOf("Win32_ComputerSystem")
 for Each objCompSys in colCompSys
     WScript.Echo "Startup Delay Before: " &amp; objCompSys.SystemStartupDelay
     objCompSys.SystemStartupDelay = 10
     objCompSys.Put_
     WScript.Echo "Startup Delay After: " &amp; objCompSys.SystemStartupDelay
 next</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.xiitec.com/blog/2008/02/20/configuring-system-startup-options/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Putting System Information on the Desktop</title>
		<link>http://www.xiitec.com/blog/2008/02/20/putting-system-information-on-the-desktop/</link>
		<comments>http://www.xiitec.com/blog/2008/02/20/putting-system-information-on-the-desktop/#comments</comments>
		<pubDate>Wed, 20 Feb 2008 20:56:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[System configuration]]></category>

		<guid isPermaLink="false">http://www.xiitec.com/blog/?p=150</guid>
		<description><![CDATA[If you maintain more than three or four servers, it can be difficult to distinguish them when you are logged onto the console or logged on with Terminal Services. And if you support multiple vendor models that have different hardware, it can be even more difficult to remember what is installed on each computer. Fortunately, [...]]]></description>
			<content:encoded><![CDATA[<p>If you maintain more than three or four servers, it can be difficult to distinguish them when you are logged onto the console or logged on with Terminal Services. And if you support multiple vendor models that have different hardware, it can be even more difficult to remember what is installed on each computer. Fortunately, there is a simple, yet elegant solution. Why not just put system information on the desktop background so that as soon as you log in, you can see how much memory is installed, view the disk configuration, find out how many CPUs are installed, etc.? The guys at Sysinternals have come through for us yet again by providing the BGInfo utility that can do exactly this. It is a highly customizable tool that lets you put just about anything you could think of on the desktop background.</p>
<p><span id="more-150"></span></p>
<p>You can configure where the information should be positioned in the background, you can use any background color or wallpaper you want, and you can even choose to configure whether only Terminal Services users should see it or whether it should be available to anyone that logs on.</p>
<p><strong>Using a graphical user interface</strong></p>
<ol>
<li>Open the Sysinternals BGInfo program on the target server.</li>
<li>The default configuration information is displayed. You can modify it directly or select a new setting in the Fields box and click the Add button. You can also create your own custom settings by clicking the Custom button.</li>
<li>Click the Background button to customize the background color or bitmap.</li>
<li>Click the Position button to customize where the BGInfo is displayed on the desktop.</li>
<li>Click the Desktops button to configure the desktops where you want this information displayed. You can put it only on your desktop, on all console users&#8217; desktops, or on Terminal Services user&#8217;s desktop.</li>
<li>Click the Preview button to see what the new background would look like.</li>
<li>Click the Apply button to commit the changes.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.xiitec.com/blog/2008/02/20/putting-system-information-on-the-desktop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuring Page Files</title>
		<link>http://www.xiitec.com/blog/2008/02/18/configuring-page-files/</link>
		<comments>http://www.xiitec.com/blog/2008/02/18/configuring-page-files/#comments</comments>
		<pubDate>Tue, 19 Feb 2008 00:46:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[System configuration]]></category>
		<category><![CDATA[page file]]></category>

		<guid isPermaLink="false">http://www.xiitec.com/blog/?p=149</guid>
		<description><![CDATA[It is a common practice to move the default page file stored on the system root drive (typically C:) to a different disk to improve performance. The page files and system drive are frequently accessed by the operating system and separating them on different disks can improve performance. You may also want to increase the [...]]]></description>
			<content:encoded><![CDATA[<p>It is a common practice to move the default page file stored on the system root drive (typically C:) to a different disk to improve performance. The page files and system drive are frequently accessed by the operating system and separating them on different disks can improve performance. You may also want to increase the size of the page file or spread your page file across multiple volumes based on the needs of your system.</p>
<p><span id="more-149"></span></p>
<p><strong>Using a graphical user interface</strong></p>
<ol>
<li> From the Control Panel, open the System applet.</li>
<li>Select the Advanced tab.
<ol>
<li>On Windows Server 2003:
<ol>
<li>Under Performance, click the Settings button.</li>
<li>Click the Advanced tab.</li>
<li>Under Virtual memory, click the Change button.</li>
<li>You&#8217;ll see a list of all volumes and any page files that have been configured on them. To modify the size of an existing page file, highlight the drive the page file is on, modify the Initial size and/or Maximum size, and click Set. You can also select System managed size to let the system control the size of the page file. To add a new page file, select a drive that currently does not have a page file and select either Custom size or System managed size. If you select the former, enter the Initial size and Maximum size. Click Set when you are done. A performance tip is to set the initial size the same as the maximum size to reduce unnecessary I/O operations.</li>
</ol>
</li>
<li>On Windows 2000:
<ol>
<li>Click the Performance Options button.</li>
<li>Click the Change button.</li>
<li>You&#8217;ll see a list of all attached disks and any page files that have been configured on them. To modify the size of an existing page file, highlight the drive the page file is one, modify the Initial size and/or Maximum size, and click Set. To add a new page file, select a drive that currently does not have a page file, enter the Initial size and Maximum size, and click Set.</li>
</ol>
</li>
</ol>
</li>
</ol>
<p><strong>Using a command-line interface</strong></p>
<p>Page file information is stored in the registry, so you can use the reg.exe command to display current settings:</p>
<pre>&gt; reg query "\\<servername>\HKLM\System\CurrentControlSet\Control\Session Manager\
 Memory Management" /v PagingFiles</servername></pre>
<p>For Windows Server 2003, you can also use the systeminfo.exe command to display page file usage:</p>
<pre>&gt; systeminfo | findstr Page</pre>
<p>The list of page files is stored in a REG_MULTI_SZ value called PagingFiles in the registry. By using the reg add command you can overwrite the current settings in PagingFiles and specify the page files you want. This command configures only one page file on the system located at d:\pagefile.sys:</p>
<pre>&gt; reg add "\\<servername>\HKLM\System\CurrentControlSet\Control\Session Manager\
 Memory Management" /v PagingFiles /t REG_MULTI_SZ /d "d:\pagefile.sys 580 1024"</servername></pre>
<p>The first number after d:\pagefile.sys is the initial size in megabytes for the page file and the second number is the maximum size.</p>
<p>This command causes there to be two page files, one on the C: drive and the other on the D: drive:</p>
<pre>&gt; reg add "\\<servername>\HKLM\System\CurrentControlSet\Control\Session Manager\
 Memory Management" /v PagingFiles /t REG_MULTI_SZ /d "C:\pagefile.sys 512 1024\0D:\</servername></pre>
<pre><servername>pagefile.sys 512 1024\0"</servername></pre>
<p>You&#8217;ll need to reboot for the changes to take effect.</p>
<p><strong>Using VBScript</strong></p>
<pre>' This code displays the current page files on the system.
 ' ------ SCRIPT CONFIGURATION ------
 strComputer = "."
 ' ------ END CONFIGURATION ---------
 set objWMI = GetObject("winmgmts:\\" &amp; strComputer &amp; "\root\cimv2")
 set colPF = objWMI.InstancesOf("Win32_PageFileUsage")
 for each objPF in colPF
    Wscript.Echo objPF.Name
    Wscript.Echo "  Initial Size: " &amp; objPF.AllocatedBaseSize
    Wscript.Echo "  Max Size: " &amp; objPF.CurrentUsage
    WScript.Echo "  Peak Usage: " &amp; objPF.PeakUsage
    WScript.Echo
 next</pre>
<p>You cannot change the size of a Page file with the Win32_PageFileUsage class (or any other WMI class), you can only retrieve a page file&#8217;s properties.</p>
<p>There are two types of memory on computers: random access memory (RAM) (or physical memory) and virtual memory. RAM is stored on specialized chips and is very fast, whereas virtual memory is stored on hard drives and is comparatively slow. On Windows systems, paging files are used to allocate space for virtual memory.</p>
<p>The operating system uses RAM when possible, but when the limits of RAM are exceeded it turns to virtual memory. When the system needs to make room in RAM (e.g., when you open a new application), it pages out the most infrequently used sections of RAM to virtual memory. That means the system has to perform disk reads and writes during this process. Your goal with virtual memory should be to configure the paging files so that they are big enough to handle virtual memory demands and can be accessed quickly.</p>
<p>In fact, your page file configuration can have a significant impact on system performance. When the Windows operating system is first installed, a page file is created (called pagefile.sys) on the drive the operating system is installed on. As I mentioned in the Problem section, you should consider moving this page file to a separate drive so that there isn&#8217;t a lot of contention for disk I/O when the system needs to access virtual memory. An even better practice is to create two page files. It is a good idea to have a page file on a non-system partition, but you may still want a page file on the system partition to handle memory dumps. If there is no page file on the system drive and a system crash (blue screen) occurs, the system will not be able to write out a memory dump that can be used to troubleshoot the crash. Windows uses the page file on the least busy partition, so it should primarily use the non-system partition page file for virtual memory. It is also worth noting that you shouldn&#8217;t bother with creating two page files unless you have at least two disks. Creating multiple paging files on the same disk doesn&#8217;t buy you much in terms of performance.</p>
<p>Regarding the size of the page files, the general rule of thumb is to have at least 1.5 times the amount of RAM, which is the default configuration. So if you had 1 GB of RAM, you should have at least a 1.5-GB paging file. The largest any one page file can be on a single disk is 4 GB.</p>
<p>Another issue to consider if security is a concern for you is clearing the paging files during system shutdown. Some applications write sensitive information, such as passwords, to RAM. If that data gets paged out to virtual memory, it can end up in a page file. That information can remain in the page file for a considerable amount of time (even after reboot) until that space is needed for something else. While the page files are protected by the operating system, it is possible (although not very easy, mind you) for an attacker that has gained control over the system to read that file and any data within it. The solution for this is to clear the page files whenever the system shuts down. To enable this you need to modify a registry setting and reboot the computer. See MS KB 182086 for more information.</p>
<p><strong>Using a graphical user interface</strong><br />
The System Managed option I described in the graphical solution is only available in Windows Server 2003. It is a new feature that lets the system determine how big the page file needs to be. It is a good practice to use this setting unless you have a very good reason not to do so.</p>
<p><strong>Using a command-line interface</strong><br />
Be careful when configuring the page files from the command line. Thoroughly test your command before trying it on a production system. The last thing you want to do is mess up the page files on your systems!</p>
<p><strong>Using VBScript</strong><br />
None of the WMI classes allow you to configure the page files directlyyou can only view them. If you need to do it programmatically, your best bet would be to use the Registry WMI provider to set the corresponding registry values for page files as I described in the command-line solution.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xiitec.com/blog/2008/02/18/configuring-page-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Viewing and Setting Environment Variables</title>
		<link>http://www.xiitec.com/blog/2008/02/18/viewing-and-setting-environment-variables/</link>
		<comments>http://www.xiitec.com/blog/2008/02/18/viewing-and-setting-environment-variables/#comments</comments>
		<pubDate>Mon, 18 Feb 2008 23:48:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[System configuration]]></category>
		<category><![CDATA[environment variables]]></category>

		<guid isPermaLink="false">http://www.xiitec.com/blog/?p=148</guid>
		<description><![CDATA[Environment variables are very similar in concept to the variables you&#8217;d find in a programming language: there is a variable identifier and an associated value. This is extremely handy because it means that you don&#8217;t always have to know the exact path or name of certain settings on the system.

For example, let&#8217;s say you wanted [...]]]></description>
			<content:encoded><![CDATA[<p>Environment variables are very similar in concept to the variables you&#8217;d find in a programming language: there is a variable identifier and an associated value. This is extremely handy because it means that you don&#8217;t always have to know the exact path or name of certain settings on the system.</p>
<p><span id="more-148"></span></p>
<p>For example, let&#8217;s say you wanted to view the NetLogon log file on a remote system. After you log on to the system, you have to locate the file. On your computer it is located in C:\WINNT\Debug, but that directory might not exist on the remote computer. You then perform a search for the file and find it is located in D:\Windows\Debug. If you used environment variables, finding the file would have been a lot easier. On your machine, the Debug directory lives in the C:\WINNT directory, which is the default system root path. On the remote server it was D:\Windows. The default system root directory on Windows Server 2003 is \Windows, but since it is on the D: drive in this case, that means whoever installed the OS chose a nondefault drive (which is fine). Regardless of where the system root is, the SystemRoot environment variable defines this path for us. By simply enclosing SystemRoot in percent signs (%), we could have found our file much quicker (%systemroot%\debug\netlogon.log).</p>
<p><strong>Using a graphical user interface</strong></p>
<ol>
<li> From the Control Panel, open the System applet.</li>
<li>Select the Advanced tab.</li>
<li>Click the Environment Variables button.</li>
<li>Click the New button under the User variables or System variables box depending on whether you want to create an environment variable that is visible only to the currently logged-on user or system-wide.</li>
<li>Enter the variable name and value and click OK until all windows are closed.</li>
</ol>
<p>The new variable(s) will not be available in any CMD windows that are currently open. You&#8217;ll need to close and reopen any CMD sessions in which you want to use the new variable(s).</p>
<p><strong>Using a command-line interface</strong></p>
<p>To view environment variables, run the set command. You can also view a subset of environment variables by running set and specifying the first letters of the variable(s). This command displays all environment variables that begin with USER:</p>
<pre>&gt; set user</pre>
<p>You can use the wmic utility to print environment variables on a remote system:</p>
<pre>&gt; wmic /node:"<servername>" environment list full</servername></pre>
<p>You can print the value of an environment variable using echo:</p>
<pre>&gt; echo %systemroot%</pre>
<p>To set an environment variable for use in the current CMD session, use the set command. The following command sets the FOOBAR environment variable:</p>
<pre>&gt; set FOOBAR=test</pre>
<p>FOOBAR will be valid only for the life of the CMD session you set it in. If you need to create a permanent environment variable, use setx.exe:</p>
<pre>&gt; setx FOOBAR test</pre>
<p>Just as with set, you will not be able to use the new variable in any CMD sessions you had open before creating it (other than the one in which it was created).</p>
<p>With the Windows Server 2003 version of setx (which comes with the OS), you can even set new environment variables on a remote server:</p>
<pre>&gt; setx FOOBAR test /s <servername> /u <username> /p
<password> </password></username></servername></pre>
<p><strong>Using VBScript</strong></p>
<pre>' This code prints the environment variables.
 ' ------ SCRIPT CONFIGURATION ------
 strComputer = "."
 ' ------ END CONFIGURATION ---------
 set objWMI = GetObject("winmgmts:\\" &amp; strComputer &amp; "\root\cimv2")
 set colVars = objWMI.InstancesOf("Win32_Environment")
 for each objVar in colVars
    WScript.Echo objVar.Name &amp; ": " &amp; objVar.variableValue &amp; _
                 " (" &amp; objVar.Username &amp; ")"
 next</pre>
<pre>' This code shows how to expand an environment variable.
 set objShell = CreateObject("WScript.Shell")
 WScript.Echo objShell.ExpandEnvironmentStrings("%systemroot%\notepad.exe")</pre>
<pre>' This code creates a new system environment variable called FOOBAR.
 ' ------ SCRIPT CONFIGURATION ------
 strVarName = "FOOBAR"
 strVarValue = "Foobar Value"
 strComputer = "."
 ' ------ END CONFIGURATION ---------
 set objVarClass = GetObject("winmgmts:\\" &amp; strComputer &amp; _
                             "\root\cimv2:Win32_Environment")
 set objVar = objVarClass.SpawnInstance_
 objVar.Name = strVarName
 objVar.VariableValue = strVarValue
 objVar.UserName = "<system>"
 objVar.Put_
 WScript.Echo "Created environment variable " &amp; strVarName</system></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.xiitec.com/blog/2008/02/18/viewing-and-setting-environment-variables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing and Resetting the Secure Channel</title>
		<link>http://www.xiitec.com/blog/2008/02/18/testing-and-resetting-the-secure-channel/</link>
		<comments>http://www.xiitec.com/blog/2008/02/18/testing-and-resetting-the-secure-channel/#comments</comments>
		<pubDate>Mon, 18 Feb 2008 23:40:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[System configuration]]></category>
		<category><![CDATA[secure channel]]></category>

		<guid isPermaLink="false">http://www.xiitec.com/blog/?p=147</guid>
		<description><![CDATA[The following command tests the secure channel for a  computer:
&#62; nltest /server:&#60;ComputerName&#62; /sc_query:&#60;DomainName&#62;
The following command resets the secure channel for a  computer:
&#62; nltest /server:&#60;ComputerName&#62; /sc_reset:&#60;DomainName&#62;

The following solutions describe how to reset a computer account.
Using a graphical user interface

Open the Active Directory Users and Computers snap-in.
If you need to change domains, right-click on Active [...]]]></description>
			<content:encoded><![CDATA[<p>The following command tests the secure channel for a  computer:</p>
<pre>&gt; nltest /server:<em>&lt;ComputerName&gt;</em> /sc_query:<em>&lt;DomainName&gt;</em></pre>
<p>The following command resets the secure channel for a  computer:</p>
<pre>&gt; nltest /server:<em>&lt;ComputerName&gt;</em> /sc_reset:<em>&lt;DomainName&gt;</em></pre>
<p><span id="more-147"></span></p>
<p>The following solutions describe how to reset a computer account.</p>
<p><strong>Using a graphical user interface</strong></p>
<ul>
<li>Open the Active Directory Users and Computers snap-in.</li>
<li>If you need to change domains, right-click on Active Directory  Users and Computers in the left pane, select Connect to Domain, enter  the domain name, and click OK.</li>
<li>In the left pane, right-click on the domain and select Find.</li>
<li>Beside Find, select Computers.</li>
<li>Type the name of the computer and click Find Now.</li>
<li>In the Search Results, right-click on the computer and select Reset Account.</li>
<li>Click Yes to verify.</li>
<li>Click OK.</li>
<li>Rejoin the computer to the domain.</li>
</ul>
<p><strong>Using a command-line interface</strong></p>
<p>You can use the <em>dsmod.exe</em> utility to reset a computer&#8217;s password.  You will need to rejoin the computer to the domain after doing this.</p>
<pre>&gt; dsmod computer  "<em>&lt;ComputerDN&gt;</em>" -reset</pre>
<p>Another option is to use the <em>netdom.exe</em> command, which  can reset the computer so that you do not need to rejoin it to the domain.</p>
<pre>&gt; netdom reset <em>&lt;ComputerName&gt;</em> /Domain <em>&lt;DomainName&gt;</em> /UserO <em>&lt;UserUPN&gt;</em> /PasswordO *</pre>
<p><strong>Using VBScript</strong></p>
<p>&#8216; This code resets an existing computer object&#8217;s password to the &#8216;  initial default. You&#8217;ll need to rejoin the computer after doing this.  set objComputer = GetObject(&#8220;LDAP://<em>&lt;ComputerDN&gt;</em>&#8220;) objComputer.SetPassword &#8220;<em>&lt;ComputerName&gt;</em>&#8221;</p>
<p>Every member computer in an Active Directory domain  establishes a secure channel with a domain controller. The computer&#8217;s  password is stored locally on the machine in the form of a Local Security Authority (LSA) secret  and also in Active Directory with the computer&#8217;s account. The NetLogon  service on the computer uses this password to establish the secure  channel with a domain controller. If for some reason the LSA secret and  computer password become out of sync, the computer will no longer be  able to authenticate in the domain. The nltest  /sc_query:<em>&lt;DomainName&gt;</em> and nltest  /sc_verify:<em>&lt;DomainName&gt;</em> commands can query a  computer to verify its secure channel is working. Here is sample output from the  nltest /sc_query command when things are working:</p>
<pre>Flags: 30 HAS_IP  HAS_TIMESERVTrusted DC Name \\dc1.rallencorp.comTrusted DC Connection Status Status = 0 0x0 NERR_Success

The command completed successfully</pre>
<p>If its secure channel is failing, you&#8217;ll need to  reset the secure channel. If that doesn&#8217;t work, you&#8217;ll need to reset  the computer account. Here is sample output when things are not working  or if you are logged in with cached credentials:</p>
<pre>Flags: 0Trusted DC NameTrusted DC Connection Status Status = 1311 0x51f ERROR_NO_LOGON_SERVERS

The command completed successfully</pre>
<p>To reset the computer, set the computer account  password to the name of the computer. This is the default initial  password for new computers. Every 30 days Windows 2000 and newer  systems automatically change their passwords in the domain. After  you&#8217;ve set the password, you&#8217;ll need to rejoin the computer to the  domain since it will no longer be able to communicate with a domain  controller due to unsynchronized passwords. However, the netdom  reset  command will try to reset the password on both the computer and in  Active Directory. If successful, you won&#8217;t have to manually rejoin the  computer to the domain. Unfortunately, the actions executed by netdom reset  cannot be done either from the GUI or from VBScript.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xiitec.com/blog/2008/02/18/testing-and-resetting-the-secure-channel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
