Thursday, October 8, 2009

Check Internet Explorer Version of Client Computers

Following batch script requires two variables to be set with actual values.
Set 'InputFile' variable with a file name with path from where it will pick computer names.
This file should contain computer name on each line, like:

PC1
PC2
PC3

Set "OutputFile" variable with a file name including path where it will store the results.
So here you go...

:: SCRIPT START::
@ECHO OFF
SET InputFile=C:\Computers.txt
SET OutputFile=C:\IEInfo.txt

IF NOT EXIST "%InputFile%" ECHO **ERROR** "%InputFile%" file does not exist. &GOTO :ExitScript
FOR %%R IN ("%InputFile%") DO IF %%~zR EQU 0 ECHO **ERROR** "%InputFile%" file is empty! &GOTO :ExitScript
FOR /F "delims=" %%C IN ('TYPE "%InputFile%"') Do (
    PING -n 1 -l 10 -w 100 %%C |FIND /I "TTL" >NUL
    IF NOT ERRORLEVEL 1 (
        ECHO Processing: %%C
        FOR /F "tokens=3" %%v IN ('REG QUERY "\\%%C\HKLM\SOFTWARE\Microsoft\Internet Explorer" /v Version ^|FIND /I "REG_SZ"') DO (
            ECHO Computer: %%C    IE Version: %%v>>"%OutputFile%"))ELSE (ECHO **ERROR** Unable to connect %%C))
       
ECHO. &ECHO Script finish, check "%OutputFile%" file for result.

:ExitScript
ECHO.
PAUSE
:: SCRIPT END::

Sunday, September 27, 2009

Default Password List – Networking Devices

Phenoelit-us maybe the simplest and best password list website.

http://www.phenoelit-us.org/dpl/dpl.html

7 Free Default Password List Websites - Something You Need to Bookmark

http://www.smashingpasswords.com/7-free-default-password-list-websites-something-you-need-bookmark

Would you appreciate this information?
Well, I'm sure many would ;-)

Thursday, September 24, 2009

Search Specific User or a Group inside Local Administrators Group of Domain Computers

Following script will search for specific user or a group inside local administrators group of domain computers.

You only have to set 'ObjectName' variable inside a script to the username of a group name.

@ECHO OFF
SET ObjectName=Domain Users

SET Counter=0
SET OutputFile=GroupInfo.txt
FOR /F "delims=\\ " %%c IN ('NET VIEW ^|FIND "\\"') DO (
    PING -n 1 -l 10 -w 100 %%c |FIND /I "TTL" >NUL
    IF NOT ERRORLEVEL 1 (
        ECHO Processing: %%c
        WMIC /NODE:"%%c" PATH Win32_GroupUser WHERE ^(GroupComponent="win32_group.name=\"Administrators\",Domain=\"%%c\""^) GET PartComponent |FIND /I "%ObjectName%" >NUL
        IF NOT ERRORLEVEL 1 (
            SET /A Counter+=1
            ECHO =============================>>"%OutputFile%"
            ECHO Machine: %%c >>"%OutputFile%"
            ECHO =============================>>"%OutputFile%"
            ECHO Date: %DATE%  Time: %TIME% >>"%OutputFile%"
            ECHO Administrators group members:>>"%OutputFile%"
            WMIC /OUTPUT:TmpResult.txt /NODE:"%%c" PATH Win32_GroupUser WHERE ^(GroupComponent="win32_group.name=\"Administrators\",Domain=\"%%c\""^) GET PartComponent /FORMAT:CSV
            FOR /F "Tokens=5 Delims==," %%u IN ('TYPE TmpResult.txt') DO ECHO %%~u >>"%OutputFile%"
            ECHO. >>"%OutputFile%"
            ECHO ALERT: '%ObjectName%' exists in Administrators group of %%c computer.)))

IF EXIST TmpResult.txt DEL /F /Q TmpResult.txt
IF %Counter% GTR 0 (
    ECHO. &ECHO SUMMARY: Found %Counter% machine^(s^) having '%ObjectName%' in Administrators Group.
    ECHO For more info check '%OutputFile%' file on %CD%) ELSE (
    ECHO. &ECHO SUMMARY: No machine found having '%ObjectName%' in Administrators Group.)

:ExitScript
ECHO.
PAUSE

Wednesday, September 23, 2009

Automatically Add Default Route for VPN Connection

One common problem that most of the users face after connecting to VPN server is ROUTING.
To enable VPN users to access network resources that are on a different subnet you need to have gateway a address that routes data packets.

We usually remove "Use default gateway on remote network” check in advanced properties on TCP/IP setting while creating VPN connection. This setting enforces to add route to remote subnet manually.
This configuration leads to the problem when RRAS server assigns IP addresses dynamically, which mean that VPN users will get different IP address each time when they connect to the RRAS server!

In Windows you can view routing table by applying following statement from command line:
Click Start -> Run -> Cmd -> OK

ROUTE PRINT

 Following batch script will help network admins to provide users with a batch file that will automatically set route to the corporate network.

You only have to set two variables inside a script. Set ‘NetSubnet’ with a network subnet address and ‘SubnetMask’ with the subnet mask.

:: ************ Method -1 ************ ::
@ECHO OFF
COLOR 8F

SET NetSubnet=172.16.0.0
SET SubnetMask=255.255.0.0

ECHO.
ECHO ###########################################################
ECHO            PLEASE DO NOT CLOSE THIS WINDOW     
ECHO This window will automatically disappear after 10 seconds.
ECHO ###########################################################
ECHO.
FOR /F %%I IN ('ROUTE PRINT ^|FIND "WAN (PPP/SLIP)"') DO SET IFindex=%%I
ECHO Updating Routing Table, please wait....
ECHO.
ROUTE DELETE %NetSubnet% >NUL
ROUTE ADD %NetSubnet% MASK %SubnetMask% 0.0.0.0 IF %IFindex%
ROUTE PRINT %NetSubnet%
PING -n 10 -w 1 -l 1 127.0.0.1 >NUL
EXIT /B 0

:: ************ Method -2 ************ ::

@ECHO OFF
COLOR 8F
SET NetSubnet=172.16.0.0
SET SubnetMask=255.255.0.0
ECHO.
ECHO ###########################################################
ECHO            PLEASE DO NOT CLOSE THIS WINDOW      
ECHO This window will automatically disappear after 10 seconds.
ECHO ###########################################################
ECHO.
SET cWMIC=WMIC NICCONFIG WHERE "ServiceName='NdisWan'" GET IPAddress /FORMAT:CSV
FOR /F "tokens=2 delims=,{}" %%i IN (' %cWMIC% ^|FIND "."') DO SET IPAddress=%%i
ECHO Obtained IP address: %IPAddress%
ECHO.
ECHO Updating Routing Table, please wait....
ECHO.
ROUTE DELETE %NetSubnet% >NUL
ROUTE ADD %NetSubnet% MASK %SubnetMask% %IPAddress% METRIC 1
ROUTE PRINT %NetSubnet%
PING -n 10 -w 1 -l 1 127.0.0.1 >NUL
EXIT /B 0

Optionally if you want this batch script to dial VPN connection then you can use following batch script. It will dial VPN connection and will set route for the remote subnet.

:: ************ Method -1 ************ ::

@ECHO OFF
COLOR 8F
SET NetSubnet=172.16.0.0
SET SubnetMask=255.255.0.0
ECHO.
ECHO ###########################################################
ECHO            PLEASE DO NOT CLOSE THIS WINDOW     
ECHO This window will automatically disappear after 20 seconds.
ECHO ###########################################################
ECHO.
ECHO Dialing VPN, please wait....
RASDial ConnectionName MyUsername MyP@ssw0rd
PING 127.0.0.1 -n 15 -l 0 -w 0 >NUL
FOR /F %%I IN ('ROUTE PRINT ^|FIND "WAN (PPP/SLIP)"') DO SET IFindex=%%I
ECHO.
ECHO Updating Routing Table, please wait....
ECHO.
ROUTE DELETE %NetSubnet% >NUL
ROUTE ADD %NetSubnet% MASK %SubnetMask% 0.0.0.0 IF %IFindex%
ROUTE PRINT %NetSubnet%
PING -n 5 -w 1 -l 1 127.0.0.1 >NUL
EXIT /B 0

:: ************ Method -2 ************ ::
@ECHO OFF
COLOR 8F
SET NetSubnet=172.16.0.0
SET SubnetMask=255.255.0.0
ECHO.
ECHO ###########################################################
ECHO            PLEASE DO NOT CLOSE THIS WINDOW      
ECHO This window will automatically disappear after 20 seconds.
ECHO ###########################################################
ECHO.
ECHO Dialing VPN, please wait....
RASDial ConnectionName MyUsername MyP@ssw0rd
ECHO.
ECHO Obtaining IP Address, please wait....
PING 127.0.0.1 -n 15 -l 0 -w 0 >NUL
SET cWMIC=WMIC NICCONFIG WHERE "ServiceName='NdisWan'" GET IPAddress /FORMAT:CSV
FOR /F "tokens=2 delims=,{}" %%i IN (' %cWMIC% ^|FIND "."') DO SET IPAddress=%%i
ECHO Obtained IP address: %IPAddress%
ECHO.
ECHO Updating Routing Table, please wait....
ECHO.
ROUTE DELETE %NetSubnet% >NUL
ROUTE ADD %NetSubnet% MASK %SubnetMask% %IPAddress% METRIC 1
ROUTE PRINT %
NetSubnet%
PING -n 5 -w 1 -l 1 127.0.0.1 >NUL
EXIT /B 0


In above script beside setting ‘NetSubnet’ and ‘SubnetMask’ variables and you have to provide required information to RASDial command.
RASDial command syntax is

              RASDial entryname [username [password|*]] [/DOMAIN:domain]

 Here 'entryname' is the connection name (shown in image below) that have created under 'Network Connections' for dialing VPN connection.


Monday, September 21, 2009

Searching Network for Specific Process Running Machines

Following batch script will help system administrators to find machines on a network with a specific running process.

You only have to set 'ProcessName' variable inside a script with the process name (i.e. calc.exe) that you want to find.

@ECHO OFF
SET ProcessName=calc.exe

SET Counter=0
FOR /F "delims=\\ " %%c IN ('NET VIEW ^|FIND "\\"') DO (
PING -n 1 -l 10 -w 100 %%c |FIND /I "TTL" >NUL
IF NOT ERRORLEVEL 1 (
    ECHO Processing: %%c
    TASKLIST /S %%c /V /FI "IMAGENAME eq %ProcessName%" /FO LIST |FIND /I "PID" >NUL
    IF NOT ERRORLEVEL 1 (
        SET /A Counter+=1
        ECHO =================================>>ProcessInfo.txt
        ECHO Machine: %%c >>ProcessInfo.txt
        ECHO =================================>>ProcessInfo.txt
        ECHO Date: %DATE%  Time: %TIME% >>ProcessInfo.txt
        FOR /F "tokens=3" %%u IN ('REG QUERY "\\%%c\HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultUserName ^|FIND /I "REG_SZ"') DO (
            ECHO Logged-in username: %%u >>ProcessInfo.txt)
        TASKLIST /S %%c /V /FI "IMAGENAME eq %ProcessName%" /FO LIST >>ProcessInfo.txt
        ECHO.>>ProcessInfo.txt)))

IF %Counter% GTR 0 (
    ECHO. &ECHO Found %Counter% machine^(s^) with running '%ProcessName%' process.
    ECHO For more info check 'ProcessInfo.txt' on %CD%) ELSE (
    ECHO. &ECHO No machine found with '%ProcessName%' running.)

:ExitScript
ECHO.
PAUSE
 

Tuesday, September 15, 2009

Getting Dell Service Tag from Command Line


Now you don't need to switch off your PC and search in BIOS for system Service Tag! Service Tag is a unique five- to seven- digit alphanumeric (letter and number) code, which is found on a white bar-coded label affixed to your Dell computer or peripheral. Entering the service tag of your Dell computer or peripheral helps Dell deliver solutions tailored to the products you own.

Try following one-liners to get local or remote system service tag:

Click Start -> Run -> Cmd.exe -> now try one of the following statement:

Local System

WMIC SYSTEMENCLOSURE GET SerialNumber
                                      OR
WMIC BIOS GET SerialNumber

Remote System

WMIC /NODE:ComputerName SYSTEMENCLOSURE GET SerialNumber
                                       OR
WMIC /NODE:ComputerName BIOS GET SerialNumber

Remote System with Credentials

WMIC /USER:"DOMAIN\Username" /NODE:ComputerName SYSTEMENCLOSURE GET SerialNumber
                                       OR
WMIC /USER:"DOMAIN\Username" /NODE:ComputerName BIOS GET SerialNumber
                                      OR
WMIC /USER:"DOMAIN\Username" /PASSWORD:"P@ssw0rd" /NODE:ComputerName SYSTEMENCLOSURE GET SerialNumber
                                      OR
WMIC /USER:"DOMAIN\Username" /PASSWORD:"P@ssw0rd" /NODE:ComputerName BIOS GET SerialNumber

Monday, August 31, 2009

AYATS AND AHADITHS THAT PROVE HIJAB OF FACE NOT ONLY EXISTS BUT IS FARZ

Allaah says (interpretation of the meaning):
“O Prophet! Tell your wives and your daughters and the women of the believers to draw their cloaks (veils) all over their bodies (i.e. screen themselves completely except the eyes or one eye to see the way). That will be better, that they should be known (as free respectable women) so as not to be annoyed. And Allaah is Ever Oft‑Forgiving, Most Merciful”
[al-Ahzaab 33:59]

In the Sunnah there are many ahaadeeth, such as: the Prophet (peace and blessings of Allaah be upon him) said: “The woman in ihraam is forbidden to veil her face (wear niqaab) or to wear the burqa’.” This indicates that when women were not in ihraam, women used to cover their faces.

This does not mean that if a woman takes off her niqaab or burqa’ in the state of ihraam that she should leave her face uncovered in the presence of non-mahram men. Rather she is obliged to cover it with something other than the niqaab or burqa’, on the evidence of the hadeeth of ‘Aa’ishah (may Allaah be pleased with her) who said: “We were with the Prophet (peace and blessings of Allaah be upon him) in ihraam, and when men passed by us, we would lower the khimaar on our heads over our faces, and when they moved on we would lift it again.”

He also said:
It is OK to cover the face with the niqaab or burqa’ which has two openings for the eyes only, because this was known at the time of the Prophet (peace and blessings of Allaah be upon him), and because of necessity. If nothing but the eyes show, this is fine, especially if this is customarily worn by women in her society. 

Ibn Taymiyah (may Allaah have mercy on him) said:
“Allaah commands women to let the jilbaab come down (over their faces) so that they will be known (as respectable women) and not be annoyed or disturbed. This evidence supports the first opinion. ‘Ubaydah al-Salmaani and others stated that the women used to wear the jilbaab coming down from the top of their heads in such a manner that nothing could be seen except their eyes, so that they could see where they were going. It was proven in al-Saheeh that the woman in ihraam is forbidden to wear the niqaab and gloves. This is what proves that the niqaab and gloves were known among women who were not in ihraam. This implies that they covered their faces and hands.”

Allaah says (interpretation of the meaning):
“And tell the believing women to lower their gaze (from looking at forbidden things), and protect their private parts (from illegal sexual acts) and not to show off their adornment except only that which is apparent (like both eyes for necessity to see the way, or outer palms of hands or one eye or dress like veil, gloves, headcover, apron), and to draw their veils all over Juyoobihinna (i.e. their bodies, faces, necks and bosoms)…”
[al-Noor 24:31]

Ahmad said: the adornment which is apparent is the clothing. And he said: every part of a woman is ‘awrah, even her nails. It was narrated in the hadeeth, ‘The woman is ‘awrah,’ This includes all of the woman. It is not makrooh to cover the hands during prayer, so they are part of the ‘awrah, just like the feet. Analogy implies that the face would be ‘awrah were it not for the fact that necessity dictates that it should be uncovered during prayer, unlike the hands.”
Sharh al-‘Umdah, 4/267-268.

It was narrated that ‘Aa’ishah (May Allah be Pleased with her) said: “The riders used to pass by us when we were with the Messenger of Allaah (peace and blessings of Allaah be upon him) in ihraam. When they came near, each of us would lower her jilbaab from her head over her face, and when they passed by we would uncover (our faces).”
Narrated by Abu Dawood, 1833; Ahmad, 24067

It is well known that a woman should not put anything over her face when she is in ihraam, but ‘Aa’ishah and the Sahaabiyaat (women of the Sahaabah) who were with her used to lower part of their garments over their faces because the obligation to cover the face when non-mahrams pass by is stronger than the obligation to uncover the face when in ihraam.

It was narrated that ‘Aa’ishah (may Allaah be pleased with her) said: “May Allaah have mercy on the women of the Muhaajireen. When Allaah revealed the words (interpretation of the meaning)
 ‘and to draw their veils all over Juyoobihinna (i.e. their bodies, faces, necks and bosoms)…”
[al-Noor 24:31], they tore their aprons and covered their faces with them.”
(Narrated by al-Bukhaari, 4480)

It was narrated from ‘Aa’ishah (May Allah be Pleased with her) … that Safwaan ibn al-Mu’attal al-Sulami al-Dhakwaani was lagging behind the army. He came to where I had stopped and saw the black shape of a person sleeping. He recognized me when he saw me, because he had seen me before hijaab was enjoined. I woke up when I heard him saying ‘Inna Lillaahi wa inna ilayhi raaji’oon (verily to Allaah we belong and unto Him is our return),’ when he saw me, and I covered my face with my jilbaab.”
(Narrated by al-Bukhaari, 3910; Muslim, 2770)

It was narrated from ‘Abd-Allaah that the Prophet (peace and blessings of Allaah be upon him) said: “The woman is ‘awrah and when she goes out the Shaytaan gets his hopes up.”
(Narrated by al-Tirmidhi, 1173)

Verily Allah give strength to all those who follow his commands. He open doors of the Hearts of the people He loves. May Allah Give us a chance to follow what ever He said truely, faithfully and completely.


Fataawa al-Mar’ah al-Muslimah, 1/399

Allaah says (interpretation of the meaning):
“And tell the believing women to lower their gaze (from looking at forbidden things), and protect their private parts (from illegal sexual acts) and not to show off their adornment except only that which is apparent (like both eyes for necessity to see the way, or outer palms of hands or one eye or dress like veil, gloves, headcover, apron), and to draw their veils all over Juyoobihinna (i.e. their bodies, faces, necks and bosoms) and not to reveal their adornment except to their husbands, or their fathers, or their husband’s fathers, or their sons, or their husband’s sons, or their brothers or their brother’s sons, or their sister’s sons, or their (Muslim) women (i.e. their sisters in Islam), or the (female) slaves whom their right hands possess, or old male servants who lack vigour, or small children who have no sense of feminine sex. And let them not stamp their feet so as to reveal what they hide of their adornment. And all of you beg Allaah to forgive you all, O believers, that you may be successful”
[al-Noor 24:31]

The evidence from this verse that hijab is obligatory for women is as follows:


(a)       Allaah commands the believing women to guard their chastity, and the command to guard their chastity also a command to follow all the means of doing that. No rational person would doubt that one of the means of doing so is covering the face, because uncovering it causes people to look at it and enjoy its beauty, and thence to initiate contact. The Messenger of Allaah (peace and blessings of Allaah be upon him) said: “The eyes commit zina and their zina is by looking…” then he said, “… and the private part confirms that or denies it.” Narrated by al-Bukhaari, 6612; Muslim, 2657.

(b)      Allaah says (interpretation of the meaning): “…and to draw their veils all over Juyoobihinna (i.e. their bodies, faces, necks and bosoms)  …”. The jayb (pl. juyoob) is the neck opening of a garment and the khimaar (veil) is that with which a woman covers her head. If a woman is commanded to draw her veil over the neck opening of her garment then she is commanded to cover her face, either because that is implied or by analogy. If it is obligatory to cover the throat and chest, then it is more appropriate to cover the face because it is the site of beauty and attraction.

(c)       Allaah has forbidden showing all adornment except that which is apparent, which is that which one cannot help showing, such as the outside of one's garment. Hence Allaah says (interpretation of the meaning): “…except only that which is apparent …” and He did not say, except that which they show of it. Some of the salaf, such as Ibn Mas’ood, al-Hasan, Ibn Sireen and others interpreted the phrase “except only that which is apparent” as meaning the outer garment and clothes, and what shows from beneath the outer garment (i.e., the hem of one’s dress etc.). Then He again forbids showing one’s adornment except to those for whom He makes an exception. This indicates that the second adornment mentioned is something other than the first adornment. The first adornment is the external adornment which appears to everyone and cannot be hidden. The second adornment is the inward adornment (including the face). If it were permissible for this adornment to be seen by everyone, there would be no point to the general wording in the first instance and this exception made in the second.

(d)      Allaah grants a concession allowing a woman to show her inward adornments to “old male servants who lack vigour”, i.e. servants who are men who have no desire, and to small children who have not reached the age of desire and have not seen the ‘awrahs of women. This indicates two things:

1 – That showing inward adornments to non-mahrams is not permissible except to these two types of people.
2 – That the reason for this ruling is the fear that men may be tempted by the woman and fall in love with her. Undoubtedly the face is the site of beauty and attraction, so concealing it is obligatory lest men who do feel desire be attracted and tempted by her.

(e)       The words (interpretation of the meaning): “And let them not stamp their feet so as to reveal what they hide of their adornment” mean that a woman should not stamp her feet so as to make known hidden adornments such as anklets and the like. If a woman is forbidden to stamp her feet lest men be tempted by what they hear of the sound of her anklets etc., then what about uncovering the face?

Which is the greater source of temptation – a man hearing the anklets of a woman whom he does not know who she is or whether she is beautiful, or whether she is young or old, or ugly or pretty? Or his looking at a beautiful youthful face that attracts him and invites him to look at it?
Every man who has any desire for women will know which of the two temptations is greater and which deserves to be hidden and concealed.

Allaah says (interpretation of the meaning):
“And as for women past childbearing who do not expect wedlock, it is no sin on them if they discard their (outer) clothing in such a way as not to show their adornment. But to refrain (i.e. not to discard their outer clothing) is better for them. And Allaah is All‑Hearer, All‑Knower”
[al-Noor 24:60]

The evidence from this verse is that Allaah states that there is no sin on old women who have no hope of marriage because men have no desire for them, due to their old age (if they discard their outer clothing), subject to the condition that their intention in doing so is not to make a wanton display of themselves. The fact that this ruling applies only to old women indicates that the ruling is different for young women who still hope to get married. If the ruling on discarding the outer clothing applied to all, there would be no point in singling out old women here.

The phrase “in such a way as not to show their adornment” offers further proof that hijab is obligatory for young women who hope to marry, because usually when they uncover their faces the intention is to make a wanton display (tabarruj) and to show off their beauty and make men look at them and admire them etc. Those who do otherwise are rare, and the ruling does not apply to rare cases. 

When the Prophet (peace and blessings of Allaah be upon him) commanded that women should be brought out to the Eid prayer place, they said, “O Messenger of Allaah, some of us do not have jilbaabs.” The Prophet (peace and blessings of Allaah be upon him) said, “Let her sister give her one of her jilbaabs to wear.” Narrated by al-Bukhaari and Muslim.
This hadeeth indicates that the usual practice among the women of the Sahaabah was that a woman would not go out without a jilbaab, and that if she did not have a jilbaab she would not go out. The command to wear a jilbaab indicates that it is essential to cover. And Allaah knows best.

Complied By: Bushra Meraj

Sunday, August 23, 2009

Improve System Performance

There are several small things that you should do to tune up your PC performance.

The one that I presenting for improving your system performance painlessly is through disabling Windows Performance Counters.

Microsoft Windows 2000 and Windows XP have a built-in performance monitor that essentially monitor performance on your machine.

Performance counters are the tools used by Windows to monitor and track the errors and bottlenecks in the speed and performance of Windows. But they are TOO technical in nature and are difficult to be used by a common Windows user. They can, generally be used by an IT administrator or a developer to tweak the performance related to CPU, Memory, Disk, Network, Processes Exchange and many other things. They keep on gathering their data from Windows in the background but in the process eat up precious system resources.

You can safely consider disabling Performance Counters without loosing anything. This will surely help to speedup your Windows and make it run faster.

To disable follow the steps below.

1. Download and install Extensible Performance Counter List (615kb) from Microsoft’s website [http://download.microsoft.com/download/win2000platform/exctrlst/1.00.0.1/nt5/en-us/exctrlst_setup.exe]
2. Run the program which resides in "C:\Program Files\Resource Kit\exctrlst.exe"
3. Clear the "Performance Counters Enabled" check box for each counter listed.



Note: Do realize that a lot of the information collected by the performance counters can be very helpful in analyzing problems on your computer. If your PC shows errors or maybe sometimes you face problem while installing any program that requires perticular performance counter enabled then in such situation make sure to enable all counters then install that program and then you can disable all the counters again.

Once I encountered likewise problem while installing Microsoft Visual Studio, then I have to enable "PerfOS" performance counter (shown in image below) to proceed with the installation.

Saturday, August 22, 2009

Auto Domain Users Home Drive Share Creation

I have seen many posts on different forums regarding a script that can automatically create domain users home drive share and automatically assign share permissions.
So I thought to write a script that can ease system administrators job.

The beauty of this script is that it creates user folders in its respective OU name directory and assign them Read and Change share permissions. It also assigns "Domain Admins" a Full Control permission.






The only thing that you require is Administrators rights and you need to set two variables (SrvName, SrvDir) inside this script. Set SrvDir variable name with the Server name that holds users home drive share and set SrvDir with the actual path where these folder are to you created.

Following script requires RMTShare.exe program that Microsoft has placed on their FTP site at [ftp://ftp.microsoft.com/bussys/winnt/winnt-public/reskit/nt40/i386/RMTSHAR.EXE]

After downloading RMTSHAR.EXE, double-click it to extract the Readme.txt and Rmtshare.exe files.
Copy Rmtshare.exe to a folder where you save this script.

So here you go....

:: SCRIPT START ::
@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION

::User Editable Variables - START
SET SrvName=\\JPAKK15
SET SrvDir=G:\USERS
:: User Editable Variables - END

SET _SrvPath=%SrvName%\%SrvDir::=$%
PING -n 3 -w 1000 %SrvName:\=% |FIND /I "TTL" >NUL
IF ERRORLEVEL 1 ECHO ERROR: Invalid server name or server unreachable. &GOTO :EXITScript
IF NOT EXIST "%_SrvPath%" ECHO Invalid server path or insufficient rights. &GOTO :EXITScript
FOR /F "delims=" %%u IN ('DSQuery * -Filter "(sAMAccountType=805306368)" -Attr samAccountName -l -limit 0') DO (
    FOR /F "delims=, tokens=2" %%v IN ('DSQuery * -Filter "(sAMAccountName=%%u)" -Attr distinguishedName -l -limit 0') DO (
        SET _vTmp=%%v
        SET _OUName=!_vTmp:~3!)
        IF NOT EXIST "!_SrvPath!\!_OUName!" MKDIR "!_SrvPath!\!_OUName!"
        IF NOT EXIST "!_SrvPath!\!_OUName!\%%u" (
            ECHO Processing: %%u
            MKDIR "!_SrvPath!\!_OUName!\%%u"
            RMTShare !SrvName!\"%%u"="!SrvDir!\!_OUName!\%%u" /REMOVE Everyone /GRANT "Domain Admins":F /GRANT %%u:C /REMARK:"User Drive" >NUL))
:EXITScript
PAUSE
EXIT /B 0
:: SCRIPT END ::

Tuesday, April 21, 2009

Daylight Saving Time Patch for GMT +05:00 Islamabad, Karachi (Pakistan) Now Available

A hotfix is available to update the Daylight Saving Time for the "(GMT +5:00) Islamabad, Karachi" time zone for the year 2009 for Windows XP-based, Windows Server 2003-based, Windows Vista-based and Windows Server 2008-based computers

[http://support.microsoft.com/kb/970084]

Sunday, April 19, 2009

Manually Setting Daylight Saving Time for Pakistan (GMT +05:00 Islamabad, Karachi)

As per Microsoft article on "How to configure daylight saving time for Microsoft Windows operating systems" [http://support.microsoft.com/kb/914387] no information has been confirmed by Pakistani government regarding the DST

This is the reason you won't see "Automatically adjust clock for daylight saving changes" check box on GMT +05:00 Islamabad, Karachi zone.

This blog will help you to update Daylight saving time for GMT +05:00 Islamabad, Karachi zone, Pakistan.

The easiest method is to download "Time Zone Editor"
TZEdit.exe from MS site [http://download.microsoft.com/download/5/8/a/58a208b7-7dc7-4bc7-8357-28e29cdac52f/tzedit.exe] and Edit settings for GMT +05:00 Islamabad, Karachi as shown in following images.



Sunday, March 1, 2009

Batch script to delete files greater than a certain size

Copy and paste following batch script into notepad and save it with any file name having .cmd extension then execute script from command line.

:: BATCH SCRIPT START
@ECHO OFF

:: Set following variable for file size in Bytes (1024 Bytes=1KB, 1024KB=1MB, 1024MB=1GB)
SET /A FileSize=1048576

:: Set following variable for file extensions to check (*.* = all files)
SET Filter=*.*

:: Set following variable with path to check insided for files
SET Folder=C:\MyFolder

FOR /R "%Folder%" %%F IN (%Filter%) DO (
IF %%~zF GTR %FileSize% (
ECHO Deleting "%%F"
DEL /F "%%F"))
EXIT /B /0
:: BATCH SCRIPT END