Thursday, December 02, 2004

Overriding Pop up Blocker Settings in IE

The new Popup Blocker feature of Internet Explorer 6.0 provided in Windows XP SP2 is really good one. Even though it helps in blocking useless windows while browing on internet, sometimes it block useful windows initiated by trusted webpages also. I used to get really frustrated when emptying Hotmail or Yahoo Junk Mail folders as it used to block the confirmation window. You can set Temporarily Allow Pop ups but its really irritating at times. Also you can set the Always Allows Pop up From This Site, but what if u dont want to switch that on and decide at run time?
Yes there is a way to overcome this by holding Cntrl Key, If you want the popup window to appear then press Control Key--> Hold it and then --> Click the URL you wish to... thats it:), it overrides the popup blocker settings and allows you to see the intended window initiated by the URL.

Wednesday, November 10, 2004

Find out who is logged on?

This is in continuation to my last article about the displaying the drive details on local or remote computer using jscript.
In this part of article i have added a part of code which show the current user logged on to the given sytem. The script and its usage remains the same but output provides some extra details about logged on user.
To get the disk drive information i had used Win32_LogicalDisk class, in order to find out logged on user information i am using Win32_ComputerSystem class.

Newly added code is shown in BLUE color BOLD type

/**
* Script: CheckSpace.js
* Purpose: Prints the size and free space of all harddisk on local or remote computer and also displays the name of the user logged on.
* Author: Mukesh N. Shende
* Date: 6 Nov 2004
* Web: http://windowsexplorer.blogspot.com
* Note: Must be run under an account with sufficient
* permissions.
**/


//Code Starts Here
function main()
{
var args = WScript.Arguments;
if( args.Length == 0 )
{
GetSpace( "localhost" );
}
else if( args.Length == 1 )
{
if( args.Item( 0 ) == "/?" )
Usage();
else
GetSpace( args.Item( 0 ) );
}
else
{
Usage();
}
}
main();

// Get size and free space for all harddisks on a compute and also the user logged on details
function GetSpace( computer )
{

try
{
var wmi = GetObject( "winmgmts:{impersonationLevel=impersonate}!\\\\" + computer + "\\root\\cimv2" );
// Query for logical disk info DriveType 3 = HardDisk
var disks = wmi.ExecQuery( "SELECT * FROM Win32_LogicalDisk WHERE DriveType=3" );
var edisks = new Enumerator( disks );

//Query for computer operating system in a Windows environment.
var loggedin = wmi.ExecQuery ("Select UserName FROM Win32_ComputerSystem");
var colComputer = new Enumerator( loggedin );

var cc = colComputer.item();
//If no one is logged on to the computer.
if (cc.UserName == null)
{
print("\nNo User is Currently Logged on " + computer);
print("\nDrive Space On " + computer );
print( "-------------------------" );
}
else
{
var TheUser = cc.UserName.split("\\");

print("\nUser Logged On: " + TheUser[1]);
print("\nDrive Space On " + computer );
print( "-------------------------" );
}

for( ; !edisks.atEnd(); edisks.moveNext() )
{
var disk = edisks.item();
print( "Drive : " + disk.DeviceID );

var pfree = String( ( disk.FreeSpace / disk.Size ) * 100 );
pfree = pfree.substring( 0, pfree.lastIndexOf( "." ) + 3 ) + "%";
print( "Free : " + FormatSize( disk.FreeSpace ) + " (" + pfree + ")" );
print( "Size : " + FormatSize( disk.Size ) );

print( "-------------------------" );
}
}
catch( e )
{
print( "Error: " + e.description );
}
}

// Convert Bytes into MB
function FormatSize( size )
{
var mb = 1024 * 1024;
var rst = Math.round( size / mb );
rst = padright( rst, 6 );
return( rst + " MB" );
}

// Pad with leading spaces.Helps to format the output.
function padright( msg, size )
{
var showmsg = String( msg );
while( showmsg.length < size )
showmsg = " " + showmsg;

return( showmsg );
}

// Print
function print( msg )
{
WScript.Echo( msg );
}

// Print Usage
function Usage()
{
var app = WScript.ScriptName;
print( app + " [computer]" );
WScript.Quit( 0 );
}


// Code ends Here

Usage
1.Copy the code and paste it into Notepad, save the file as "checkspace.js".
2.On command prompt go to the path of the file.
3.Type cscript checkspace.js /? which will show the help of the file
4. cscript checkspace.js will show the information about the local computer on which you are running the script.
5. cscript checkspace.js [computer] will show the information about the computer name specified as a parameter to the script.

Saturday, November 06, 2004

Into the scripting world.

Recently i was learning scripting technologies like WSH to automate certain tasks and make my work little easier.Being a Networking Professional i knew this will surely help me in my work on daily basis. The initial experience was not so interesting as i was facing lot of difficulties in understanding language specifications. I had to read on vbscript and jscript a lot. During the same time i found very nice document on microsoft technet center. The Portable Script Center found at http://www.microsoft.com/downloads/details.aspx?FamilyID=b4cb2678-dafb-4e30-b2da-b8814fe2da5a&displaylang=en was really exciting for me. After a little reading i started to build small scripts and started playing with them.

As a first assignment for myself i decided to build a script which will give me the HardDisk Size and Free Space available on given computer.After struggling for sometime i could build very handy script. I realize the importance of such script only after building it.

The JScript is as follows,

// Script Starts Here.

function main()
{
var args = WScript.Arguments;
if( args.Length == 0 )
{
GetSpace( "localhost" );
}
else if( args.Length == 1 )
{
if( args.Item( 0 ) == "/?" )
Usage();
else
GetSpace( args.Item( 0 ) );
}
else
{
Usage();
}
}
main();

// Get size and free space for all harddisks on a computer
function GetSpace( computer )
{
print( "Drive Space on " + computer );
try
{
var wmi = GetObject( "winmgmts:{impersonationLevel=impersonate}!\\\\" + computer + "\\root\\cimv2" );
// Query for logical disk info DriveType 3 = HardDisk
var disks = wmi.ExecQuery( "SELECT * FROM Win32_LogicalDisk WHERE DriveType=3" );
var edisks = new Enumerator( disks );

for( ; !edisks.atEnd(); edisks.moveNext() )
{
var disk = edisks.item();
print( "Drive : " + disk.DeviceID );

var pfree = String( ( disk.FreeSpace / disk.Size ) * 100 );
pfree = pfree.substring( 0, pfree.lastIndexOf( "." ) + 3 ) + "%";
print( "Free : " + FormatSize( disk.FreeSpace ) + " (" + pfree + ")" );
print( "Size : " + FormatSize( disk.Size ) );

print( "-------------------------" );
}
}
catch( e )
{
print( "Error: " + e.description );
}
}

// Convert Bytes into MB
function FormatSize( size )
{
var mb = 1024 * 1024;
var rst = Math.round( size / mb );
rst = padright( rst, 6 );
return( rst + " MB" );
}

// Pad with leading spaces.Helps to format the output.
function padright( msg, size )
{
var showmsg = String( msg );
while( showmsg.length < showmsg = " " app =" WScript.ScriptName;">Usage
1.Copy the code and paste it into Notepad, save the file as "checkspace.js".
2.On command prompt go to the path of the file.
3.Type cscript checkspace.js /? which will show the help of the file
4. cscript checkspace.js will show the information about the local computer on which you are running the script.
5. cscript checkspace.js [computer] will show the information about the computer name specified as a parameter to the script.

This is just a start, i am planning to explore more about such scripts and start using them.

Friday, October 29, 2004

What is a 1394 network connection?

New Windows XP users might notice a new network device labeled 1394
Connection on their system. This network device is actually your FireWire
card. Although most users use FireWire to connect video and storage
peripherals, Microsoft chose to list FireWire as a network device, which
might confuse some users{like me:)}. Either you can ignore this connection, or you
can disable it by right-clicking the connection from within Network
Connections (from the Start menu, go to Settings, Network Connections) and
selecting Disable.


Read More on http://support.microsoft.com/default.aspx?kbid=307736

Wednesday, October 13, 2004

How do I install Windows 2000 after I've installed Windows XP?

This procedure will work for FAT32 and NTFS partitions.
Thanks to Richard Fredrickson for his information on this particular fix.


Backup NTLDR and NTDETECT.COM
1) In Windows XP, open Windows Explorer and locate NTLDR and NTDETECT.COM in the root directory of your boot drive. These are usually Hidden files, so you'll have to adjust your Explorer options to show them.

2) Copy these files to a blank, formatted floppy, or other location that will be available after the Win2K install.

Install Windows 2000
1) Boot your computer from the Win2K CD and continue with the installation.

2) Proceed with the install. Install Windows 2000 to a different partition than XP is installed in.
3) Complete the Windows install. Allow the computer to boot into Windows 2000.

Repairing the Windows® XP Boot Loader
When the Windows 2000 installation is done, boot the computer into Windows 2000, not Windows XP.
1) Insert the floppy disk that you used earlier (or access the location you used), to backup NTLDR and NTDETECT.COM

2) Copy NTLDR and NTDETECT.COM back to the root directory of your boot drive. Again, you may have to adjust your Explorer Options.

Now, you'll be able to restart your computer and boot into Win 2K or Win XP.
This procedure is necessary because the Win XP version of NTLDR and NTDETECT.COM will boot Windows 2000, but not vice-versa.


Friday, August 27, 2004

Application Compatibility Testing and Mitigation Guide

In my last post i explained the procedure of creating service pack2 integrted bootable windows xp cd. Now is the time to deploy the new service packs across your network. Like me if you are also worried about the application compatibility issues after successfully deploying the service pack 2 and thinking how to overcome such situation, then fortunately there is a solution for it.

Microsoft® Windows® XP Service Pack 2 (SP2) introduces a set of security technologies that improve the ability of Windows XP systems to withstand malicious attacks, and provides the IT administrator with system wide security configuration capabilities.

SP2 is more secure by default, and thus automatically provides Windows XP systems with improved protection. However, because system security becomes more restrictive upon initial installation, SP2 may also expose application compatibility issues. It is important that an investigation into possible application compatibility issues takes place prior to full deployment.

This guidance discusses the security technologies, an application testing process, incompatibility symptoms, mitigation techniques, and deployment scenarios. It makes no assumption about the size or complexity of the network, and is as relevant to peer-to-peer environments as it is to Active Directory environments.

This is available from here - http://www.microsoft.com/downloads/details.aspx?FamilyId=9300BECF-2DEE-4772-ADD9-AD0EAF89C4A7&displaylang=en

Very nicely written and explained the changes in the service pack2.:)

Thursday, August 26, 2004

Slipstreaming Windows XP Service Pack 2

What is slipstreaming?

Slipstreaming is the technique for combining an installation CD like Windows 2000/ Windows XP, with the latest Service Pack. This drastically cuts down on the time it takes to install a PC, because the patches and OS are installed together. It helps the systems administrators to cut down on the new fresh installation timings without compromising to the security and critical updates. As a network administrator, at times it is very frustrating to install the new fresh operating system and then apply all the latest security patches appropriately. Although Microsoft provides automatic updates either directly from windows updates or using the local software update service, we still have to wait till it becomes available to the required client. Fortunately there is way to overcome this problem by installing new operating system plus the latest service pack at once.

With XP Service Pack 2 just released, users and IT departments across the world are ready to test and update their Microsoft-based PCs with its new features. Updating to service pack 2 (SP2) is a time consuming process, especially if you have more than one PC to upgrade. As usual, Microsoft has published the service pack in the form of a single downloadable file for IT professionals who need to apply it to multiple machines over a network. This is all well and good, but what if you are dealing with dozens of new systems which require XP to be installed, along with its latest service pack?

The idea of installing Windows XP first then applying its latest service pack to each machine seems to be unnecessary. IT department of any company want to be smart and efficient to handle the growing requirements of the today’s business. Fortunately there is an easier way of doing this smartly; Slipstreaming refers to the process of creating a new bootable installation CD or network file for Windows XP installation which contains all the original operating system files, plus the latest Service Pack.

Prerequisites
You will need to have the following things in place before you start the slipstreaming.

1.Original Windows XP Pro / Home CD
2.Any CD Burner with the appropriate software for the CD cutting.(I have used Nero 6.0)
3.Window XP Service Pack 2,
available from here
4.ISObuster for extracting the Boot Image from the original CD.
5.At least 2 GB of free hard drive space for a CD install file.

Slipstreaming Steps

The following steps are applicable for the Windows XP slipstreaming but with the little changes in the steps will also help you to do it for the windows 2000 (sp4) also.

Step 1:Create directories
First thing you must do is create a pair of separate directories XP-CD and XP- SP2 to hold the Windows XP installation CD and Service Pack 2 data in it.

The location of these directories could be anywhere on your hard drive but just remember the path while passing the update command later.

Step 2: Copy Windows CD Contents

Place your windows XP cd into your CD-Rom / CDRW and Copy all files and folders from the Windows XP CD to the folder created C:\XP-CD

Step 3: Extract the service pack files

Assuming that you have downloaded the right Service Pack 2 file,

We will move on to the next step of extracting the service pack files to the second folder XP- SP2. To extract the files open the command prompt by clicking START->Run->cmd

Then type the name of the service pack file with the –x parameter

A window will pop up prompting you for a location to uncompress the service pack files to. Enter the location of the 'C:\XP-SP2' directory you just created and hit OK. The service pack files will be extracted to that location.

You can also use the WinZip to extract the files to the specified folder.

Step 4: Updating the 'C:\XP-CD' directory with Windows XP Service Pack 2

In this step, we run the 'update' command built into each service pack with the 'integrate' switch, which will merge our Service Pack 2 files with the Windows XP install CD files and folders we copied onto our hard drive in the last 2 step (C:\XP-CD).
While still at the command prompt, type 'CD C:\XP-SP2\i386\update' to enter that directory


Then type the update command as 'update /S:(yourdrivename):\XP-CD' and hit enter to begin the update process. A window will come up and detail the install procedure.

Step 5: Extracting the Windows XP boot image from the CD

We need a bootable CD image file in order to create a bootable CD from our newly modified XP files. The Windows XP install CD already has a perfectly usable boot file; we just need to get at it. ISObuster is a free tool for accessing and extracting files from CDs and CD images.

ISObuster software is
available here.

Insert your Windows XP install CD into the drive and open up ISObuster. Navigate to the 'bootable CD' directory. In the right hand pane, highlight 'Microsoft Corporation.IMG'. Right click it and select 'Extract Microsoft Corporation.IMG' Extract the file to your 'C:\XP- CD' directory.

Step 6: Create the bootable Windows XP Service Pack 2 CD with Nero Version 6

Now its time to create the fresh new bootable cd with SP2 integrated. To do this I am using Nero 6 but you can also use other cd writing software like Roxio Easy CD.

-> Start up Nero and select 'CD-Rom (boot)' as the type of disk you wish to make.
-> From the 'boot' tab, change the image file to the 'Microsoft Corporation.IMG' file that you extracted from the XP CD in the last step. (Note that you will have to change the 'files of type' box from '.IMA' files to 'all files' in order to locate your file in its directory.)
->Check 'enable expert settings.' In this section,
->
You will need to change the 'kind of emulation' dropdown box to 'no emulation' and the 'number of loaded sectors' value to 4

->Now change to the 'ISO' tab.
->Change the 'file name length' dropdown box to 'max. Of 31 chars (ISO level 2)' all boxes on the screen should be checked.
->It's essential that the version of Nero you are using supports the 'do not add the ";1" ISO file version extension' option, or the CD you create will not boot properly.
->If you have an older version of Nero, you will need to upgrade to version 5.5 or newer.

Now click New Button to open Nero CD Content Explorer.In the file browser to the right, navigate to your 'C:\XPCD' directory and expand it. Now select all of the files and folders in the far right pane and drag them into either of the blank panes to the left. Delete 'Microsoft Corporation.IMG' file in the left window, since it is not needed on the CD.

Now click the 'burn' button on the toolbar and check the 'write' and 'finalize CD' options before burning the CD. Now you can use your newly created disk to install Windows XP with Service pack 2 already installed!

Legal Issues

Please note that while you can use the streamlining method to create an updated version of your own Windows XP CD with Service Pack 2 installed, this does not give you the legal right to use it on more than one machine at a time. A Windows XP license can still only be used on a single system at a time, unless you are using a volume license. OEM licenses (versions of Windows pre-installed on assembled computers) are considered to apply only to the computer they are first installed on, and may not be transferred to other systems. Be aware of these issues when preparing and creating your new CD.

Important Links

Windows XP Service Pack 2
http://www.microsoft.com/downloads/details.aspx?FamilyID=049c9dbe-3b8e-4f30-8245-9e368d3cdb5a&DisplayLang=en

IsoBuster
http://www.smart-projects.net/isobuster/

Monday, June 07, 2004

Restricted Groups Feature is really great.

I had question in my mind "Is it possible to create a Local administration user account on a Workstation via Group Policies in Server 2003? If yes, how do you do it?” When I searched for it I found really nice knowledge base article explaining the entire procedure to achieve that.

Restricted Groups under[Computer Configuration\Windows Settings\Security Settings\Restricted Groups]is a feature of the Group Policy which allows you to set up policies which ensure consistent membership in certain groups, such as Administrators, Power Users etc. For example, you can configure the GPO to include a certain domain group into Administrators group on all computers affected by this GPO

The benefit of using restricted groups is that it acts as any other policy set up by GP: if the membership of any group configured as a restricted is broken (someone has manually removed groups and users added to Administrators, for example), it will be automatically restored at the next policy refresh.

Microsoft Knowledge Base Article - 320065

Although the article says that
"The information in this article applies to:"
Microsoft Windows 2000 Server
Microsoft Windows 2000 Advanced Server
Microsoft Windows 2000 Professional

I have personally checked it on my Windows Server 2003 Ent. Edition and it works well.

Friday, May 21, 2004

Strange thing with Windows 2003 and ATX Cabinet.

I just noticed one thing on one of my Windows 2003 Servers, Standard Edition.
The system on which the server is installed is having Athlon XP 1700 Processor on Via chipset Motherboard with 512 MB SD RAM inside the ATX cabinet.
On same machine with Windows 2000 and with XP you can shutdown the system by using Power Key provided on the keyboard(nothing great, often it is standard feature) without even logging in. When i tried the same thing Windows 2003 at the logon screen it didn't work. To surprise me more when i logged in and tried the same thing, server went down without even showing the shutdown tracking dialog box. So if someone presses the power key by mistake while configuring some important sofware(like VS.NET and any server product) the server will go down without even taking proper permission from the user.

Wednesday, May 19, 2004

Repair IIS mappings for ASP.NET

To repair IIS mappings for ASP.NET, run the Aspnet_regiis.exe utlity. To do so, follow these steps:
1. Click Start, and then click Run.
2. Type cmd, and then click OK.
3. At the command prompt, run the following command, and then click OK:
"\WINNT\Microsoft.NET\Framework\v1.0.3705\aspnet_regiis.exe" -i
NOTE: If your computer runs on an operating system other than Micrsoft Windows NT, replace \WINNT with the name of the directory where the operating system is installed.

To repair IIS mappings for ASP.NET, you must register Aspnet_isapi.dll. To do so, follow these steps:
1. Click Start, and then click Run.
2. Type regsvr32 Windows folder\Microsoft.NET\Framework\v1.0.3705\aspnet_isapi.dll, and then click OK. Regsvr32 returns the results of the registration.