16 April, 2009

Get real help with "Performance Advisor"

Hello,
I came across an excellent tool for Trouble Shooting from Microsoft named "Performance Advisor v2", if you need a real in-depth help - try this one.
It will give you pre-saved templates for all kind of servers and problems. And the most important - it will help understand the results.

I had performance issues on a Domain Controller and after using this tool, I could tell which server is stressing the DC and with what query !!!

Amazing...

Here is a link to the download: http://www.microsoft.com/downloads/details.aspx?FamilyID=09115420-8c9d-46b9-a9a5-9bffcd237da2&DisplayLang=en

[Will only work on Windows 2003 server...]


Update:
There is v3 at: http://msdn.microsoft.com/en-us/library/windows/hardware/dn481522.aspx  will work on newer versions (need SQL now...)

05 April, 2009

Install Software (mostly MS patches) by OS type

You want to install MS patch but there are 2 kind of patches, one for XP and one for Win2k3.
Here is a small script to let you do just this.
It basically query the registry for the OS type search for a string and run a program by the output.

=================================
reg query HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions find "WinNT"
if %errorlevel% == 0 (goto xp) else (goto server)
:xp

\\nt_dn\netlogon\timezonepatch\WindowsXP-KB955839.exe /quiet /norestart
goto end
:server

\\nt_dn\netlogon\timezonepatch\WindowsServer2003-KB955839.exe /quiet /norestart
:end
=================================

Enjoy...

02 April, 2009

Run Scripts With GPP

Hi,


You may work with GPP and noticed that you cannot run scripts with this excellent technology.



Well, I found a way to override this by adding a registry key in the user settings to the RunOnce key (HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce), this way the script only run once and also, if the user login at home (laptop user) the script will not run.


Very much like a logon script but using GPP.



01 April, 2009

See which machine is alive...

If you need to run on a list of machines with some command, you want to make sure that the workstations (or servers) are alive and pingble.
The following script allow you to do just that.
It contains 3 elements:
  1. "computers.txt" - the full list of computers in your LAN (probably from AD), names only!!!
  2. "Step1.cmd" - run's the next file in a loop on each line from "computers.txt"
  3. "Step2.cmd" - The command itself.

content of step1.cmd:
======================
for /f %%A in (computers.txt) do (step2.cmd %%A)
======================

content of step2.cmd:
======================
ping -n 1 -w 300 %1 find "TTL">nul
IF %ERRORLEVEL% == 0 (echo %1 >> alive.txt) ELSE (echo %1 >> dead.txt)
======================

Put them all in the same directory, execute step1.cmd and the script will split the big list into 2 small lists, alive.txt and dead.txt - the content is self applies...

By for now...