Ashish's Note

Over the past few years, I learnt a lot and get fond of Microsoft Technlogy. From The basics of Active Directory to the high end troubleshooting and disaster recovery, to the VPN configuration, Its being a good time for me as I got lots of opportunities to learn and grow.

In 2004, I got hired by "Microsoft" as a full time employee in its GTSC located in Bangalore. I experienced hardcore troubleshooting on real time issues as a big challange and very very intersting, which gave me vibrant knowledge of Operating System Troubleshooting, Active Directory, Clustering, Performance, Disks, Terminal Server, Printing, STOP Codes and BSOD screens.

My Fantastic past experience on HP/MSCS cluster, Server Hardware and System Administration, boosted my skills to take charge of customer's problem and make me to deal with the issues till the resolution.

Today working with Perot Systems, I am using this Blog to contribute my knowledge to the society and to make every individual who need directives to grow in IT field.

Lets post your views and questions you have, hit my brain to let it mentor the best possible IT solutions and career options.


Ashish Sharma.

Saturday, July 7, 2007

FORFILES: Select a file tree to process a batch job like delete function

Microsoft reskit tool “forfiles” do a search in specific folder and its subfolders, can delete files with time stamp criteria.

I was using this utility when I was in Microsoft and played with the log file of various servers.

The folling command line can be used to delete 30 days old files from the path given, including subfolders:

forfiles –p[TREE_PATH] -s -m*log* -d-30 -c"cmd /c del @FILE"

Wednesday, June 27, 2007

Letting a User Start and Stop Services Without Granting the User Administrator Privileges

Services have ACLs like other objects do, so you can grant services specific start and stop permissions. Unfortunately, the Microsoft Management Console (MMC) Services snap-in doesn't expose service ACLs in the interface, but two other methods for editing service permissions are available.

With the first method, you create a security template via the MMC Security Templates snap-in and navigate to the System Services folder. Open the Service Properties page, select the Define this property check box, and click Edit Security, which opens the ACL for the service. Grant the consultant Start, stop and pause permission. Save the policy, and apply it by using the MMC Configuration and Analysis snap-in.

The other method is more direct but it requires that you use the command line. Using the /service parameter with the Subinacl command lets you grant permissions to a service. For example, to grant Randy in domain Acme Start, stop and pause permission for the Spooler service, open a command line and type

subinacl /service spooler /grant=acme\randy=top

Note that you must specify the service name of the service, not its display name. You can get a list of all services with their display names and actual names by typing the command sc query

You can download Subinacl from When you execute the subinacl.msi file, it installs the Subinacl command and a Help file in the %programfiles%\Windows Resource Kits\Tools folder.

Thursday, May 31, 2007

Script: Retrieving Free Disk Space

Flash Tip: Illustrated Script - Retrieving Free Disk Space

Q: How do I retrieve free disk space from drive C?

A: The script below illustrates the importance of Automation objects within Microsoft Visual Basic Scripting Edition (VBScript). If you have been having problems with users filling up drive C on their computers, you can use the three-line script below to find out how much free disk space is available on drive C of a computer.

Set objWMIService = GetObject("winmgmts:")
Set objLogicalDisk = objWMIService.Get("Win32_LogicalDisk.DeviceID='c:'")
Wscript.Echo objLogicalDisk.FreeSpace

You now have a custom solution for identifying the computers running low on disk space, a solution developed using very little VBScript code. Instead, the script:
Connects to Windows Management Instrumentation (WMI), an Automation object, by using the VBScript GetObject method.
Uses the WMI Get method to retrieve information about drive C.
Uses the Windows Script Host (WSH) Echo method to report the amount of free disk space on drive C.
The primary purpose of the little VBScript code that is used is to glue together the functionality of WMI and WSH.
Based on “VBScript Primer,” from the book Microsoft Windows 2000 Scripting Guide by Microsoft Corporation. Reprinted by permission of Microsoft Press. All rights reserved. For more information, go to

Tuesday, May 29, 2007

How to Join Vista machine in NT domain

1. SRVMGR.EXE on the PDC and add the computer name of the Vista PC.

2. On Vista PC run, secpol.msc then Under Local Policies > Security Options, Change the following two settings"

- Domain Member: Digitally Encrypt sign secure channel data (always) - change to disabled
- Network Security: LAN Manager authentication level - change to "Send LM and NTLM - use NTLMv2 session security if negoitated"

Friday, May 25, 2007

Extract User list from AD

Use Joe Richard's ADFind at

adfind -gc -b -f "&(objectclass=user)(ObjectCategory=person)(whenCreated>=20070101000000.0Z)(whenCreated<=20070525235959.0Z)" createTimeStamp

Way to list specific folder size and send it on email as a txt attachment

I used DirUse with a batch file as follows:

diruse /s /k /q:50 \\ComputerName\c$\test > c:\data.txt
commail -subject=FolderSize -msg=c:\data.txt

That worked Great.

commail is what I use to send email. If you need it, email me.

Wednesday, May 23, 2007

RoboCopy GUI: Good tool to copy files accross servers

This bat file can be use to create folders on multiple servers at a time

On Error Resume Next
Computers = Array("Servername1","Servername2",......)
For Each Computer In Computers
Set objWMIService = GetObject _
("winmgmts:\\" & Computer & "\root\cimv2:Win32_Process")
errReturn = objWMIService.Create _
("cmd.exe /c md c:\Foldername", Null, Null, intProcessID)