Friday, 17 September 2010

How to dump all scopes of a DHCP server?

You have to login into a DHCP server.
Go to run and type cmd

c:>netsh dhcp server \\Dhcpservername show scope dump

Monday, 23 August 2010

Thursday, 12 August 2010

How to find memory leak Using Performance Monitor

Access Performance Monitor by entering the PERFMON command at the server's Run prompt. When Performance Monitor opens, several counters (mechanisms that Performance Monitor uses to measure some individual aspect of the server's performance) will already have been loaded. Click the X icon repeatedly until all default counters have been removed. You can now load new counters by clicking the + icon.
Individual counters are organized into performance objects, which are simply categories under which Performance Monitor counters are stored. From hereon, I will refer to individual counters in performance object/counter format. For example, Processor/% Processor Time refers to the % Processor Time counter found in the Processor performance object.
To detect a memory leak using Performance Monitor, monitor these counters:
1.The Memory/Available Bytes counter lets you view the total number of bytes of available memory. This value normally fluctuates, but if you have an application with the memory leak, it will decrease over time.
2.TheMemory/Committed Bytes counter will steadily rise if a memory leak is occurring, because as the number of available bytes of memory decreases, the number of committed bytes increases.
3.The Process/Private Bytes counter displays the number of bytes reserved exclusively for a specific process. If a memory leak is occurring, this value will tend to steadily rise.
4.The Process/Page File Bytes counter displays the size of the pagefile. Windows uses virtual memory (the pagefile) to supplement a machine's physical memory. As a machine's physical memory begins to fill up, pages of memory are moved to the pagefile. It is normal for the pagefile to be used even on machines with plenty of memory. But if the size of the pagefile steadily increases, that's a good sign a memory leak is occurring.
5.I also want to mention the Process/Handle Count counter. Applications use handles to identify resources that they must access. If a memory leak is occurring, an application will often create additional handles to identify memory resources. So a rise in the handle count might indicate a memory leak. However, not all memory leaks will result in a rise in the handle count.

Monday, 9 August 2010

How to disable/enable remote login in windows server?

c:>change logon /disable
c:>change logon /enable

Note c:>change logon /disable, after putting this you are not able to login remotely but you can login locally or use psexec \\ server name cmd
c:\windows\system32>change logon /enable

How to change RDP port?

Go to registry & change the PortNumber(default : 3389)

[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Terminal Server\WinStations\RDP-Tcp]

After changeing the registry reboot is required.

Friday, 6 August 2010

Diffrerce between Windows 2003 and 2008 Quorum Model

Windows 2008
1.Node Majority

2.Node and Disk Majority
3.Node and File Share Majority
4.No Majority: Disk Only
Windows 2003
1.Local quorum

2.Single quorum device
3.Majority node set

For deep dive please see the below links.

Thursday, 5 August 2010

move cluster resource using the command line cluster.exe

cluster group "GROUPNAME" /move
Use it for two node cluster
cluster group "R1 Print" /moveto:test01

Use it for more than two node cluster.

Sunday, 1 August 2010

How to extend windows 2008 License?

Go to cmd and type
slmgr /rearm

Reboot the server.

You can extend the license upto 1 year but it will not extend the Terminal server license.

Saturday, 31 July 2010

Schema Version

Schema Version:-
Windows 2000 :13
Windows 2003 :30
Windows 2003 R2:31
Windows 2008 :44
Windows 2008R2 :47

Windows Server 2012 : 56
Windows Server 2012 R2 : 69

We can see the schema version from adsiedit.msc.The attribute is "object version".

Or you can use dsquery
dsquery * cn=schema,cn=configuration,dc=domainname,dc=local -scope base -attr objectVersion

Verify ForestPrep, Domainprep & Rodcprep Result -
Powershell & DSQuery

Friday, 23 July 2010

How to find users logon name by their mail address for bulk users?

For Single user
dsquery * domainroot -filter "(&(objectCategory=Person)(objectClass=User)(mail=e-mailaddress))" -attr name

For bulk users
for /f %%x in (%1) do dsquery * domainroot -filter "(&(objectcategory=person)(objectclass=user)(mail=%%x))" -attr name

Wednesday, 28 April 2010

Find all enabled/disabled AD users

QuestWinsows PowerShell
Find all enabled AD usersget-qaduser -includeallproperties -ldapfilter "(!(userAccountControl:1.2.840.113556.1.4.803:=2))"
# Get Enabled users only
Get-QADUser -Enabled -SizeLimit 0
- or -
# Get Disabled users only
Get-QADUser -Disabled -SizeLimit 0

Tuesday, 27 April 2010

How to find group membership for “n” number of users

How to find group membership for “n” number of users

Quest ActiveRoles Management Shell for Active Directory

1. How to find all users

Quest ActiveRoles Management Shell for Active Directory

Prereqisites :1: Windows XP, 2003, 2008
2: Powershell 1 or 2
3: DOT Net 3.5

2.How to find all groups

Monday, 26 April 2010

How to find group members for n number of groups

$groups=get-content groups.txt
Foreach($group in $groups)

Get-QADGroupMember $group
Get-qadgroup $group


Find memberof for n number of users with powershell

$users=get-content users.txt
Foreach($user in $users)

get-Qadmemberof $user
Get-qaduser $user


Monday, 29 March 2010

Pre-Post test for DC patching for n nos. of DC

for /f %%x in (%1) do nltest /server:%%x /dsgetsite

for /f %%x in (%1) do uptime \\%%x

for /f %%x in (%1) do dcdiag /s:%%x

for /f %%x in (%1) do repadmin /replsummary %%x

Thursday, 25 March 2010

For your reading entertainment


How many times the server was rebooted from a specific date

How many times the server was rebooted from a specific date.
Total bluedump error , System Availability & so many more .try it.
Download the exe & put it system32.
C:\Documents and Settings\Administrator>uptime /s /d:12/25/2009
Uptime Report for:
Current OS: Microsoft Windows Server 2003, Service Pack 2, Multiprocessor F
Time Zone: India Standard Time
System Events as of 12/27/2009 8:29:25 PM:
Date: Time: Event: Comment:
---------- ----------- ------------------- ------------------------------
12/28/2009 10:48:07 AM Shutdown Prior uptime:23d 1h:54m:50s
12/28/2009 12:33:53 PM Boot Prior downtime:0d 1h:45m:46s
12/28/2009 1:48:22 PM Shutdown Prior uptime:0d 1h:14m:29s
12/28/2009 1:49:04 PM Boot Prior downtime:0d 0h:0m:42s
12/28/2009 2:52:04 PM Shutdown Prior uptime:0d 1h:3m:0s
12/28/2009 6:12:00 PM Boot Prior downtime:0d 3h:19m:56s
12/28/2009 11:29:47 PM Shutdown Prior uptime:0d 5h:17m:47s
12/25/2009 12:45:54 PM Shutdown Prior uptime:0d 1h:34m:41s
12/25/2009 10:53:15 PM Boot Prior downtime:0d 10h:7m:21s
12/26/2009 12:35:23 AM Shutdown Prior uptime:0d 1h:42m:8s
12/26/2009 10:53:02 AM Boot Prior downtime:0d 10h:17m:39s
12/26/2009 11:12:54 AM Shutdown Prior uptime:0d 0h:19m:52s
12/26/2009 12:05:21 PM Boot Prior downtime:0d 0h:52m:27s
12/26/2009 1:02:14 PM Shutdown Prior uptime:0d 0h:56m:53s
12/26/2009 11:01:24 PM Boot Prior downtime:0d 9h:59m:10s
12/27/2009 1:29:07 AM Shutdown Prior uptime:0d 2h:27m:43s
12/27/2009 10:20:35 AM Boot Prior downtime:0d 8h:51m:28s
12/27/2009 2:06:17 PM Shutdown Prior uptime:0d 3h:45m:42s
12/27/2009 2:33:31 PM Boot Prior downtime:0d 0h:27m:14s
12/27/2009 3:00:11 PM Shutdown Prior uptime:0d 0h:26m:40s
12/27/2009 5:55:18 PM Boot Prior downtime:0d 2h:55m:7s
Current System Uptime: 0 day(s), 2 hour(s), 34 minute(s), 32 second(s)
Since 12/25/2009: (Last 2 Days)
System Availability: -39.6115%
Total Uptime: 4d 14h:44m:57s
Total Downtime: 3d 23h:37m:13s
Total Reboots: 15
Mean Time Between Reboots: 0.19 days
Total Bluescreens: 0


How to check the uptime for "n" number of servers

Create a batch file with below mentioned line & create a txt file with server list.
Put the uptime.exe in system32

for /f %%x in (%1) do uptime \\%%x

Monday, 22 March 2010


1. How to find all members for a particular group.

>dsget group "" -members

2. How to find memberof , lastlogontimestamp , homemta(Mail server) , Samaccountname & so on(Repadmin /showattr <"DN">)

>dsquery * "" -scope base -attr lastlogontimestamp memberoff
>repadmin /showattr <"DN"> /attrs:lastlogon,homemta,whencreated,lastlogontimestamp,samaccountname

3. How to modify user last name.

>dsmod user -ln ""

4. How to find memberof , lastlogontimestamp , homemta(Mail server) , Samaccountname & so on for "n" number of users

>Create a batch file(for /f "eol= tokens=* delims= usebackq" %%x in (%1) do dsquery * %%x -scope base -attr sAMAccountName objectsid whencreated lastlogontimestamp mail homeMTA memberof) e.g ds.bat
>Create a text file (All users DN e.g:dn.txt)
>Open cmd & run ds.bat dn.txt >> c:\attr.txt

5. How to find DN for n number of computers

>for /f %%x in (%1) do dsquery computer -name %%x
(Create a batch file with line & create a txt file computer.txt
>open cmd >>>>>>batchfile computer.txt >> c:\dn.txt
6. Find Subnet with associated site.
>>dsquery subnet -name | dsget subnet
7. How to find all the active users
>dsquery * -filter "(&(objectCategory=person)(objectClass=user)(!userAccountControl:1.2.840.113556.1.4.803:=2))"

8.How to find disabled users
>dsquery user "dc=ssig,dc=com" -disabled

9. How to find OS?

>D:\>dsquery * <"DN"> -scope base -attr operatingSystem
Windows Server 2003

10. How to find site ?

>dsquery site -name * -limit 0

>dsquery server -s | dsget server -site

11. How to get tombstonelifetime

>dsquery * "CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration,DC=yourdomain,DC=com" -scope base -attr tombstonelifetime

12.How do find the all servers for a specific site ?

> dsquery server -site Sitename

13. How to find mail box

>dsquery * -filter "samaccountname=biswajit" -attr homemdb

14.Find all computers in AD that have not been logged into during the past 10 weeks

>dsquery computer -inactive 10 -limit 0