Category Archives: Server Infrastructure

Stop Filling Harddisk Space from System Restore

Dear All

This article shows how to stop the Harddisk space usage of System Restore in Vista

How System Restore works
System Restore is designed to take snapshots, called restore points, of your system state before certain types of operations, such as installing new drivers or installing Windows updates, are initiated. That way if a problem results from those types of operations, you can revert back to the restore point and essentially recover, or restore, your system to the state that it was in before the problem occurred.
These snapshots are taken by the Volume Shadow Copy Service. In addition to taking care of creating the restore points, the Volume Shadow Copy Service also monitors data files for the Previous Versions feature.
Using VSSAdmin
In order to manage the Volume Shadow Copy Service and ultimately System Restore, you’ll use the VSSAdmin command-line tool — there is no GUI tool in Vista for configuring System Restore. In order to run VSSAdmin, you must launch an elevated Command Prompt window.
To begin,
right-click on the Command Prompt shortcut
select the Run as Administrator command
When you encounter the UAC, you will need to respond appropriately.
You can now use the VSSAdmin command-line tool
to investigate and configure System Restore and the Shadow Copy Service.

For example, you can obtain a list of all the restore points currently saved on the system by using the command: vssadmin list shadows
You can see how much disk space is allocated to and used by System Restore and the Shadow Copy Service system by using the command:

c:\> vssadmin list shadowstorage
The investigation
On the Vista system that was running out of disk space, the result of the vssadmin list shadowstorage command is shown in Figure A. As you can see the Maximum Shadow Copy Storage space settings was set to Unbounded, which means that there is no limit to the size it can grow and it was already at 40GB.

Figure A

The Maximum Shadow Copy Storage space setting on the problem system was set to Unbounded.
On another Vista test system, running on an 80GB hard disk, the Maximum Shadow Copy Storage space setting was set to 11GB, as shown in Figure B. This was a much more reasonable value. Why the value on one of my test systems was set to unbounded while the others had specific maximum values, I’m not sure.

Figure B

The Maximum Shadow Copy Storage space setting on another system was set to 11GB.
The solution
You can reset the value of the Maximum Shadow Copy Storage space setting using the command:

vssadmin resize shadowstorage /for= /on= [/maxsize=
e.g.. i will reset the Maximum Shadow Copy Storage space setting to 15GB using the

vssadmin resize shadowstorage /for=c: /on=c: /maxsize=15GB
Once the operation was complete, I restarted the system, and everything has been running normally since


Prashant Deshpande


1 Comment

Filed under General, IT Support, Operating System, Server Infrastructure

Remotely Monitor Websites using Browser

Dear all

Following is the script which opens website in Internet explorer and collects the output from IE and if any error occurs in IE window it will send SMS and Email containing error caputered in IE window

it takes name of website from a text file and then opens in IE.

Requirement create Folder on c: with name c:\checkme1 keep the contains of zip file in it and schedule the script in task schedular

Click to Download


Prashant Deshpande

Leave a comment

Filed under General, IT Support, Server Infrastructure, ServerMonitoring

Working with FSMO Roles

How to make DC with same Domain name in exisiting Network


1)      Install ADC first and then seize the FSMO rols as



Windows 2000/2003 Active Directory domains utilize a Single Operation Master method called FSMO (Flexible Single Master Operation), as described in Understanding FSMO Roles in Active Directory.


The five FSMO roles are:


  • Schema master – Forest-wide and one per forest.


  • Domain naming master – Forest-wide and one per forest.


  • RID master – Domain-specific and one for each domain.


  • PDC – PDC Emulator is domain-specific and one for each domain.


  • Infrastructure master – Domain-specific and one for each domain.


In most cases an administrator can keep the FSMO role holders (all 5 of them) in the same spot (or actually, on the same DC) as has been configured by the Active Directory installation process. However, there are scenarios where an administrator would want to move one or more of the FSMO roles from the default holder DC to a different DC.


Moving the FSMO roles while both the original FSMO role holder and the future FSMO role holder are online and operational is called Transferring, and is described in the Transferring FSMO Roles article.


However, when the original FSMO role holder went offline or became non operational for a long period of time, the administrator might consider moving the FSMO role from the original, non-operational holder, to a different DC. The process of moving the FSMO role from a non-operational role holder to a different DC is called Seizing, and is described in this article.


If a DC holding a FSMO role fails, the best thing to do is to try and get the server online again. Since none of the FSMO roles are immediately critical (well, almost none, the loss of the PDC Emulator FSMO role might become a problem unless you fix it in a reasonable amount of time), so it is not a problem to them to be unavailable for hours or even days.


If a DC becomes unreliable, try to get it back on line, and transfer the FSMO roles to a reliable computer. Administrators should use extreme caution in seizing FSMO roles. This operation, in most cases, should be performed only if the original FSMO role owner will not be brought back into the environment. Only seize a FSMO role if absolutely necessary when the original role holder is not connected to the network.


What will happen if you do not perform the seize in time? This table has the info:




Loss implications




The schema cannot be extended. However, in the short term no one will notice a missing Schema Master unless you plan a schema upgrade during that time.


Domain Naming


Unless you are going to run DCPROMO, then you will not miss this FSMO role.




Chances are good that the existing DCs will have enough unused RIDs to last some time, unless youre building hundreds of users or computer object per week.


PDC Emulator


Will be missed soon. NT 4.0 BDCs will not be able to replicate, there will be no time synchronization in the domain, you will probably not be able to change or troubleshoot group policies and password changes will become a problem.




Group memberships may be incomplete. If you only have one domain, then there will be no impact.


Important: If the RID, Schema, or Domain Naming FSMOs are seized, then the original domain controller must not be activated in the forest again. It is necessary to reinstall Windows if these servers are to be used again.


The following table summarizes the FSMO seizing restrictions:








Original must be reinstalled


Domain Naming




PDC Emulator


Can transfer back to original




Another consideration before performing the seize operation is the administrators group membership, as this table lists:




Administrator must be a member of




Schema Admins


Domain Naming


Enterprise Admins




Domain Admins


PDC Emulator




To seize the FSMO roles by using Ntdsutil, follow these steps: Caution: Using the Ntdsutil utility incorrectly may result in partial or complete loss of Active Directory functionality.


  1. On any domain controller, click Start, click Run, type Ntdsutil in the Open box, and then click OK.


Microsoft Windows [Version 5.2.3790]


(C) Copyright 1985-2003 Microsoft Corp.







  1. Type roles, and then press ENTER.


ntdsutil: roles


fsmo maintenance:


Note: To see a list of available commands at any of the prompts in the Ntdsutil tool, type ?, and then press ENTER.


  1. Type connections, and then press ENTER.


fsmo maintenance: connections


server connections:


  1. Type connect to server <servername>, where <servername> is the name of the server you want to use, and then press ENTER.


server connections: connect to server server100


Binding to server100 …


Connected to server100 using credentials of locally logged on user.


server connections:


  1. At the server connections: prompt, type q, and then press ENTER again.


server connections: q


fsmo maintenance:


  1. Type seize <role>, where <role> is the role you want to seize. For example, to seize the RID Master role, you would type seize rid master:


Options are:


Seize domain naming master


Seize infrastructure master


Seize PDC


Seize RID master


Seize schema master


  1. You will receive a warning window asking if you want to perform the seize. Click on Yes.


fsmo maintenance: Seize infrastructure master


Attempting safe transfer of infrastructure FSMO before seizure.


ldap_modify_sW error 0x34(52 (Unavailable).


Ldap extended error message is 000020AF: SvcErr: DSID-03210300, problem 5002 (UNAVAILABLE)


, data 1722



Win32 error returned is 0x20af(The requested FSMO operation failed. The current FSMO holde


r could not be contacted.)




Depending on the error code this may indicate a connection,


ldap, or role transfer error.


Transfer of infrastructure FSMO failed, proceeding with seizure …


Server "server100" knows about 5 roles


Schema – CN=NTDS Settings,CN=SERVER200,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=dpetri,DC=net


Domain – CN=NTDS Settings,CN=SERVER100,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=dpetri,DC=net


PDC – CN=NTDS Settings,CN=SERVER100,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=dpetri,DC=net


RID – CN=NTDS Settings,CN=SERVER200,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=dpetri,DC=net


Infrastructure – CN=NTDS Settings,CN=SERVER100,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=dpetri,DC=net


fsmo maintenance:


Note: All five roles need to be in the forest. If the first domain controller is out of the forest then seize all roles. Determine which roles are to be on which remaining domain controllers so that all five roles are not on only one server.


  1. Repeat steps 6 and 7 until youve seized all the required FSMO roles.


  2. After you seize or transfer the roles, type q, and then press ENTER until you quit the Ntdsutil tool.


Note: Do not put the Infrastructure Master (IM) role on the same domain controller as the Global Catalog server. If the Infrastructure Master runs on a GC server it will stop updating object information because it does not contain any references to objects that it does not hold. This is because a GC server holds a partial replica of every object in the forest.


Leave a comment

Filed under Virtualization

Session break from ASP.Net State Server

Dear All

Today i came across one fact that when we implement Web Farm and
configure ASP.Net State werver to handle Sessions , If  web server is
utilising CPU near to 100% OR state server is near to 100% CPU  Usage
then Session can break in two ways
1) the web server which si utilising near to 100% will reject the
session commin from State Server
2) State Server will reject session if it is near to 100% CPU Usage
This is because by default 10 seconds is the time period for session
management between web server and ASP.Net State Server,
We can overcome this by doing following settings
1) In State Server
                  a)  Stop the ASP.NET state server service.
                  b)  Click Start, click Run, type Regedt32.exe, and
then click OK to start Registry Editor.
                  c) Locate the following key in the registry:
         Add a DWORD value that is named SocketTimeout.
and set to 30 ( means 30 seconds)

2) In web.config of all web servers  add
           stateNetworkTimeout="30"    ( 30 is equl to State server
Sockettimeout value)

 This will; increase the session managemnet time from 10 seconds to 30
secs which will overcome the Session breaking.


Prashant Deshpande


Leave a comment

Filed under Web Farm

Monitor CPU and Physical Memory (RAM)

Dear All

Please find here with the Script which can be scheduled after every 2 mins on server which will monitor the CPU and Memory Usage on server and if CPU usage goes above the limit specified by us and free memory below the limit given by us (default i have kept Memory Limit 512 mb and CPU usage limit 90 %)

If free memory goes below 512mb or CPU usage above 90% then it will send email so that we can take appropriate action

you will need to change the email ids and verify that SMTP server is installed and working on server.

 Click to download Script


 Prashant Deshpande



Leave a comment

Filed under ServerMonitoring


Dear All


Following script can be scheduled on server to run after every 5 minutes which will monitor the free RAM on server and if RAM free RAM goes below 256mb then it wll send email.


dim str,mess
Check_Available_Virtual_Memory str,256

Function Check_Available_Virtual_Memory(strComputer,strThresholdMB)
dim wbemServices,wbemObjectSet,wbemObject,AvailableVMB,strStatus
EXPLANATION = "Failed, error getting values."

Set wbemServices = GetObject("winmgmts:\\" & strComputer)
Set wbemObjectSet = wbemServices.InstancesOf("CIM_OperatingSystem")

For Each wbemObject In wbemObjectSet
strStatus="Available Physical Memory=" & AvailableVMB & "mb, Threshold=" & strThresholdMB & "mb"

if AvailableVMB > strThresholdMB then
EXPLANATION = "Success, " & strStatus

EXPLANATION = "Failure, " & strStatus

dim j, NIC1, Nic, StrNic, lngCount, StrIP, i ,objNet,objHost
‘If something fails, move on
On Error Resume Next
‘Get the Computer’s network name
Set objNet=CreateObject("wscript.Network")
‘Wscript.Echo "Analysis of " & objHost & "."

‘Get a connection to the WMI NetAdapteConfig object
Set NIC1 = GetObject("winmgmts:").InstancesOf("Win32_NetworkAdapterConfiguration")

‘For Each of the NICs in the connection
dim ip
For Each Nic in NIC1
   ‘Get the Adapter Description
   StrNIC = Nic.Description
     ‘If IP is enabled on the NIC then let’s find out about the NIC
     IF Nic.IPEnabled THEN
        For i=0 to lngCount
           If i >= 0 Then
           StrIP = vbTab & Nic.IPAddress(i)
           If StrIP <> "" Then

if ip<>"" then
ip=ip+" | "+  StrIP
    ip=   StrIP
end if
                  End If
              End If
          END IF
mess="Hi , Please check that the server ip :-"+ ip + " | The availabe RAM is less than 256 mb only , Current Memory Status is : – "+ StrStatus
SendMail "", " " , "Physical Memory Alert (RAM)"  , Mess

end if
end function

Sub SendMail(Sender, Recipient, Subject, Message)

Const MailServer = "" ‘ Mail Server to use (SMTP)
Const MailServerPort = "25" ‘ SMTP Port used at Mail server (25 is default)

Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = Subject
objMessage.From = Sender
objMessage.To = Recipient
objMessage.TextBody = Message

objMessage.Configuration.Fields.Item _
("") = 2

‘Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
("") = MailServer

‘Server port (typically 25)
objMessage.Configuration.Fields.Item _
("") = MailServerPort


End Sub




Prashant Deshpande


Leave a comment

Filed under ServerMonitoring


Dear All

Please find here with the Server Event Logs Senderscripts

When any server goes down , after restart we use to take remote of that server and then read the event logs for getting shutdown causes

here is the attached rar file which contains following Files

1)BackupEvt.vbs :- which will take backup of all Event logs

2) Create_rar.bat :- which will make zip of the backup of event log taken by BackupEvt.vbs

3) SendevtLog.vbs :- which will send the Zip of event log backup

4)Writeeventlogs.vbs :-write event logs in Text file

Detailed procedure of configuring

  Folder structure to be available

   c:\Scripts :-> wil contains all Scripts

  c:\evtlogs :- will be used for writing logs

  d:\zip :- will be used to store backup of event logs in RAR format

  1) In task schedular configure a task for writeeventlogs.vbs whcih will be getting called after every 24 hrs

  2)See to it that server/ System has installed 7-Zip and path includes it

  3) Strat -> Run –> gpedit.msc

    In computer Configuration –> Windows Settings –> Scripts –> Startup

specify the two scripts 1) Writeeventlogs.vbs

                                   2) SendevtLog.vbs

after this configuartion whenever that system / Server will get restarted it will send email notification along with the backup of event logs in RAR format to the email ids present in sendevtlogs.vbs ( change email ids as per requirement )



 Prashant Deshpande

Leave a comment

Filed under ServerMonitoring