Monday 14 November 2011

Netscan - a freeware swiss-knife tool

Netscan is the swiss knife of the tools for administrators. It reminds me of Lansweeper, but for realtime scan and information gathering from the computers and devices on the network, thumbs up for the ease of use and list of features:

 

  • Pings computers and displays those alive.
  • Detects hardware MAC-addresses, even across routers.
  • Detects hidden shared folders and writable ones.
  • Detects your internal and external IP addresses.
  • Scans for listening TCP ports, some UDP and SNMP services.
  • Retrieves currently logged-on users, configured user accounts, uptime, etc.
  • You can mount and explore network resources.
  • Can launch external third party applications.
  • Exports results to HTML, XML, CSV and TXT
  • Supports Wake-On-LAN, remote shutdown and sending network messages.
  • Retrieves potentially any information via WMI.
  • Retrieves information from remote registry, file system and service manager.
  • It is absolutely free, requires no installation, and does not contain any adware/spyware/malware.

 

Tuesday 10 May 2011

Port already in use when installing vCenter Server

Installing Virtual Center 4.1 in our new VSphere infraestructure I run into this error "port already in use". The vmware knowledge base article did not helped much, after some investigation I found that the port was in user by the service "Windows Remote Management (WS-Management)". After stopping it I could proceed with the install.

Tuesday 16 November 2010

How to remotely list scheduled tasks

I had the need of getting all details of the scheduled tasks of our servers, I could use a lot of other complex ways, but I still prefer simplicity of batch:
1. Create a file with the hostnames of all the computers you need to check for the
scheduled tasks (tasks.txt):
hostname1
hostname2
hostnameX

2. Create a batch file with (tasks.bat):
del out.csv
echo "HostName","TaskName","Next Run Time","Status","Logon Mode","Last Run Time","Last Result","Author","Task To Run","Start In","Comment","Scheduled Task State","Idle Time","Power Management","Run As User","Delete Task If Not Rescheduled","Stop Task If Runs X Hours and X Mins","Schedule","Schedule Type","Start Time","Start Date","End Date","Days","Months","Repeat: Every","Repeat: Until: Time","Repeat: Until: Duration","Repeat: Stop If Still Running">> out.csv
FOR /F %%a in (tasks.txt) Do schtasks.exe /query /fo csv /s %%a /v | FIND "%%a" >> out.csv

3. Run the batch file with a user that have admin rights on the server, you will get a CSV that can be easily imported on Excel or a similar application.

Saturday 13 November 2010

Ultimate boot CD for Windows in USB

Ultimate Boot CD for Windows is an indispensable tool when a system needs to be recovered. But when you have for instance a vĂ­rus on a computer, it's not easy to keep it up to date, because it runs on a CD that can only be updated when you write it. So it's much more flexible to have this tool on an USB pen, where I can write and update some files. There are some nice tools to make an ISO available on USB boot, I highly recommend these:
- WinSetupFromUSB - great but on Windows 7 x64 does not work well with UAC active, also supports install Windows from USB
- USB boot without BIOS support - this works great for me and can make a system boot even without USB boot support, by using an ISO that boots with USB support.

Additionally to this, I use Ketarin, a must have tool to keep virus definitions updated on the USB.

Thursday 14 October 2010

Dealing with mixed architectures on Windows

I'm deploying Windows 7 while keeping Windows XP machines at the same time. We have to create some registry entries for both x86 and x64 so the way I to do it is to create a bath file that runs like this:

@echo off
If %PROCESSOR_ARCHITECTURE% == x86 (
 set arch=%windir%\system32
 GOTO X86
) ELSE (
 set arch=%windir%\syswow64
 GOTO X64
)

:X86
REM Put here your X86 stuff
GOTO Final

:X64
REM Put here your X64 stuff
GOTO Final

:Final
%arch%\REG QUERY "HKLM\SOFTWARE\software name"
IF %Errorlevel% == 1 GOTO ADDREG
Exit

:ADDREG
%arch%\REG ADD "HKLM\SOFTWARE\software name" /v "key" /t REG_SZ /d "text" /f

Wednesday 13 October 2010

Shrink of SQL log files

Microsoft SQL 2008 can sometimes be tricky to shrink the log files in a maintenance plan. This will force the shrink of the log files:

sp_MSForEachDb 'IF ''?'' NOT IN (''master'', ''tempdb'', ''tempdev'', ''model'', ''msdb'')
AND (SELECT recovery_model FROM master.sys.databases WHERE name = '
'?'') = 1
AND (SELECT is_read_only FROM master.sys.databases WHERE name = '
'?'') = 0
BEGIN
declare @LogFile nvarchar(2000)
USE [?]
SELECT @LogFile = sys.database_files.name
FROM sys.database_files
WHERE (sys.database_files.type = 1)
PRINT @LogFile
EXEC('
'ALTER DATABASE [?] SET RECOVERY SIMPLE'')
DBCC SHRINKFILE (@LogFile, 1)
EXEC('
'ALTER DATABASE [?] SET RECOVERY FULL'')
END'

Sunday 10 October 2010

GazoPa - advanced image search

In the previous post I've mentioned TinyEye, but while exploring the web I've come across GazoPa.com, an even more advanced image search engine where we can search for similar images, or even sketch a draw of what we are searching for. Very cool!