Dell OMSA LiveCD 6.0.1

Dell OMSA LiveCD 6.0.1 provides the following features

• Safe environment to perform diagnostics or data recovery
• Access to disk diagnostics (Dell Online Diagnostics)
• Access to tape diagnostics (xTalk and IBM ITDT)
• DSET tool built into operating system
• Built in FTP and SMB shares to easily transfer files
• Built in telnet, SSH and VNC servers for remote troubleshooting
• Webex support for Dell technical support access
• OMSA 6.0.1 built in for local and remote access

Read the PDF: http://linux.ins.dell.com/files/openmanage-contributions/omsa-601-live/Guide.pdf

Download the iso: http://linux.dell.com/files/openmanage-contributions/?C=M;O=A

VB Script: DiskSpace Monitoring

When i needed a script to check multiple servers for disk usage, i found this script: http://gallery.technet.microsoft.com/ScriptCenter/en-us/cc8176ab-348b-4152-b9a3-25b6ad950d3e

Download it here: [wpdm_file id=”17″], or see the code:

'******************************************************************************
'* Provides data from disks from a list of servers (servers.txt)              *
'* Created by Nag Pal and Modify by Martin Scaine                             *
'* The original script don't manage error,                                    *
'* so if you can't connect to a server it will repeat the data from last.     *
'* Also I include the date on the name of the report file and on it header.   *
'* It can be usefull if you need to check it every day                        *
'******************************************************************************

On Error Resume Next
Const ForAppending = 8
Const HARD_DISK = 3
Const ForReading = 1

'Var declaration
dtmDay = Day(Date)
dtmMonth = Month(Date)
dtmYear = Year(Date)
dtmDate = CDate(dtmYear & "-" & dtmMonth & "-" & dtmDay)

Set objFSO = CreateObject("Scripting.FileSystemObject")

'Open the server list
Set SrvList = objFSO.OpenTextFile("Servers.txt", ForReading)

'Create a result file
If dtmday < 10 and dtmMonth >9 then
Set ReportFile = objFSO.OpenTextFile ("Srv_Disk_Space_" & dtmYear & "-" & dtmMonth & "-0" & dtmDay & ".html", ForAppending, True)
End If
If dtmday > 9 and dtmMonth < 10 then
Set ReportFile = objFSO.OpenTextFile ("Srv_Disk_Space_" & dtmYear & "-0" & dtmMonth & "-" & dtmDay & ".html", ForAppending, True)
End If
If dtmday < 10 and dtmMonth < 10 then Set ReportFile = objFSO.OpenTextFile ("Srv_Disk_Space_" & dtmYear & "-0" & dtmMonth & "-0" & dtmDay & ".html", ForAppending, True) End If If dtmday > 9 and dtmMonth >9 then
Set ReportFile = objFSO.OpenTextFile ("Srv_Disk_Space_" & dtmYear & "-" & dtmMonth & "-" & dtmDay & ".html", ForAppending, True)
End If
i = 0

'Inicializar HTML
ReportFile.writeline("")
ReportFile.writeline("")
ReportFile.writeline("")
ReportFile.writeline("")
ReportFile.writeline("")
ReportFile.writeline("
-->")
ReportFile.writeline("")
ReportFile.writeline("")

ReportFile.writeline("

“) ReportFile.writeline(“”) ReportFile.writeline(” “) ReportFile.writeline(” “) ReportFile.writeline(”

“) ReportFile.writeline(“Server Space Disk Report ” & dtmdate & ““) ReportFile.writeline(“
")

'Server name declaration
Do Until SrvList.AtEndOfStream
	StrComputer = SrvList.Readline

	Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
	Set colDisks = objWMIService.ExecQuery("Select * from Win32_LogicalDisk Where DriveType = " & HARD_DISK & "")

	If Err.Number <> 0 Then
		ReportFile.writeline("

“) ReportFile.writeline(“”) ReportFile.writeline(” “) ReportFile.writeline(” “) Err.Clear Else ReportFile.writeline(”

Error – ” & StrComputer & ” – Error

“) ReportFile.writeline(“”) ReportFile.writeline(” “) ReportFile.writeline(” “) ReportFile.writeline(“”) ReportFile.writeline(” “) ReportFile.writeline(” “) ReportFile.writeline(” “) ReportFile.writeline(” “) ReportFile.writeline(” “) ReportFile.writeline(” “) ‘Data recolection For Each objDisk in colDisks ‘Var init TotSpace=0 FrSpace=0 FrPercent=0 UsSpace=0 Drv=”Error” VolName=”Error” ‘Var charge TotSpace=Round(((objDisk.Size)/1073741824),2) FrSpace=Round(objDisk.FreeSpace/1073741824,2) FrPercent=Round((FrSpace / TotSpace)*100,0) UsSpace=Round((TotSpace – FrSpace),2) Drv=objDisk.DeviceID VolName=objDisk.DeviceID ‘Lnt=Len(VolName) ‘If Len(VolName) = 3 then If FrPercent > 20 Then ReportFile.WriteLine ” ” ElseIf FrPercent < 10 Then ReportFile.WriteLine ” ” Else ReportFile.WriteLine ” ” End If ‘Else ‘End If Next End If ReportFile.writeline(“”) ReportFile.writeline(” “) ReportFile.writeline(” “) ReportFile.writeline(”

” & StrComputer & “
Drive / Mount Total Capacity (in GB) Used Capacity (in GB) Free Space (in GB) Freespace %
” & Drv & “ ” & TotSpace & “ ” & UsSpace & “ ” & FrSpace & “ ” & FrPercent & “%” &”
” & Drv & “ ” & TotSpace & “ ” & UsSpace & “ ” & FrSpace & “ ” & FrPercent & “%” &”
” & Drv & “ ” & TotSpace & “ ” & UsSpace & “ ” & FrSpace & “ ” & FrPercent & “%” &”
")
Loop
ReportFile.WriteLine ""

Automating VMware with PowerShell

LAB Summary
Welcome to the Automating VMware with PowerShell: Hands-On Lab. This lab will provide you hands-on experience in writing PowerShell scripts for managing VMware using the VI Toolkit (for Windows). Each participant will create scripts that will show you how to more effectively manage your virtual infrastructure. Some familiarity with PowerShell is helpful, but is not required. 
 
LAB Objective
The objective of this lab is to introduce you to the VI Toolkit (for Windows) and show you how easy automating VMware Virtual Infrastructure management is when you use PowerShell. We will cover a wide range of topics, including things like provisioning, storage, networking and monitoring. 

 Link: http://blogs.vmware.com/vipowershell/files/vmworld_europe_2008_powershell_lab_7_manual.pdf

Or local download: [wpdm_file id=”15″]

ESX 3.5 Logfile Retrieval

vLogView is a Windows® based application which manages VMware® ESX Server log files.

The product is designed to be installed on an administrators PC, and provides the ability to store, view and search ESX Server log files from multiple ESX Servers, without requiring individual login, navigation and manual file transfer.

http://xtravirt.com/xd10132

Find Orphaned VMDK’s

A script to find orphaned vmdk’s on your ESX infrastructure.

Source here: http://communities.vmware.com/docs/DOC-6960

[wpdm_file id=”13″]

If you want to run it to ESX 3.5 make sure you include the snapshot files extension for it (000001.vmdk and so on).

In the following example 00001 and 00002 are added:

#
# Purpose : List all orphaned vmdk on all datastores in all VC's
# Version: 1.0
# Author  : HJA van Bokhoven

#Main

$arrayVC = "YourVirtualCenter"
$OutputFile = "c:\OrphanedVMDK.txt"

Foreach ($strVC in $arrayVC)
{
	Connect-VIServer $strVC
	$arrUsedDisks = Get-VM | Get-HardDisk | %{$_.filename}
	$arrDS = Get-Datastore
	Foreach ($strDatastore in $arrDS)
	{
	   $strDatastoreName = $strDatastore.name
	   Write-Host $strDatastoreName
	   $ds = Get-Datastore -Name $strDatastoreName | %{Get-View $_.Id}
	   $fileQueryFlags = New-Object VMware.Vim.FileQueryFlags
	   $fileQueryFlags.FileSize = $true
	   $fileQueryFlags.FileType = $true
	   $fileQueryFlags.Modification = $true
	   $searchSpec = New-Object VMware.Vim.HostDatastoreBrowserSearchSpec
	   $searchSpec.details = $fileQueryFlags
	   $searchSpec.sortFoldersFirst = $true
	   $dsBrowser = Get-View $ds.browser
	   $rootPath = "["+$ds.summary.Name+"]"
	   $searchResult = $dsBrowser.SearchDatastoreSubFolders($rootPath, $searchSpec)
	   $myCol = @()
	   foreach ($folder in $searchResult)
	   {
	      foreach ($fileResult in $folder.File)
	      {
             $file = "" | select Name, FullPath
		     $file.Name = $fileResult.Path
		     $strFilename = $file.Name
		     IF ($strFilename)
		     {
		     IF ($strFilename.Contains(".vmdk"))
		     {
		     IF (!$strFilename.Contains("-flat.vmdk"))
		     {
		     IF (!$strFilename.Contains("delta.vmdk"))
		     {
		     IF (!$strFilename.Contains("000001.vmdk"))
		     {
		     IF (!$strFilename.Contains("000002.vmdk"))
		     {
		        $strCheckfile = "*"+$file.Name+"*"
			 IF ($arrUsedDisks -Like $strCheckfile){}
	         ELSE
			 {
			 $strOutput = $strDatastoreName + " Orphaned VMDK Found: " + $strFilename
			 $strOutput | Out-File $Outputfile -width 150 -Append
			 }
		     }
		     }
		     }
		     }
		     }
		     }
	      }
	   }
   }
}

Move IIS 7 to other drive

source: http://blogs.iis.net/thomad/archive/2008/02/10/moving-the-iis7-inetpub-directory-to-a-different-drive.aspx

With the following script you can move the default IIS 7 installation path from c:\inetpub to every disk you want.

@echo off
IF "%1" == "" goto err
setlocal
set MOVETO=%1:\

REM simple error handling if drive does not exist or argument is wrong
IF NOT EXIST %MOVETO% goto err

REM Backup IIS config before we start changing config to point to the new path
%windir%\system32\inetsrv\appcmd add backup beforeRootMove

REM Stop all IIS services
iisreset /stop

REM Copy all content
REM /O - copy ACLs
REM /E - copy sub directories including empty ones
REM /I - assume destination is a directory
REM /Q - quiet

REM echo on, because user will be prompted if content already exists.
echo on
xcopy %systemdrive%\inetpub %MOVETO%inetpub /O /E /I /Q
@echo off
REM Move AppPool isolation directory
reg add HKLM\System\CurrentControlSet\Services\WAS\Parameters /v ConfigIsolationPath /t REG_SZ /d %MOVETO%inetpub\temp\appPools /f

REM Move logfile directories
%windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/sites -siteDefaults.traceFailedRequestsLogging.directory:"%MOVETO%inetpub\logs\FailedReqLogFiles"
%windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/sites -siteDefaults.logfile.directory:"%MOVETO%inetpub\logs\logfiles"
%windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/log -centralBinaryLogFile.directory:"%MOVETO%inetpub\logs\logfiles"
%windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/log -centralW3CLogFile.directory:"%MOVETO%inetpub\logs\logfiles"

REM Move config history location, temporary files, the path for the Default Web Site and the custom error locations
%windir%\system32\inetsrv\appcmd set config -section:system.applicationhost/configHistory -path:%MOVETO%inetpub\history
%windir%\system32\inetsrv\appcmd set config -section:system.webServer/asp -cache.disktemplateCacheDirectory:"%MOVETO%inetpub\temp\ASP Compiled Templates"
%windir%\system32\inetsrv\appcmd set config -section:system.webServer/httpCompression -directory:"%MOVETO%inetpub\temp\IIS Temporary Compressed Files"
%windir%\system32\inetsrv\appcmd set vdir "Default Web Site/" -physicalPath:%MOVETO%inetpub\wwwroot
%windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='401'].prefixLanguageFilePath:%MOVETO%inetpub\custerr
%windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='403'].prefixLanguageFilePath:%MOVETO%inetpub\custerr
%windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='404'].prefixLanguageFilePath:%MOVETO%inetpub\custerr
%windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='405'].prefixLanguageFilePath:%MOVETO%inetpub\custerr
%windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='406'].prefixLanguageFilePath:%MOVETO%inetpub\custerr
%windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='412'].prefixLanguageFilePath:%MOVETO%inetpub\custerr
%windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='500'].prefixLanguageFilePath:%MOVETO%inetpub\custerr
%windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='501'].prefixLanguageFilePath:%MOVETO%inetpub\custerr
%windir%\system32\inetsrv\appcmd set config -section:httpErrors /[statusCode='502'].prefixLanguageFilePath:%MOVETO%inetpub\custerr

REM Make sure Service Pack and Hotfix Installers know where the IIS root directories are
reg add HKLM\Software\Microsoft\inetstp /v PathWWWRoot /t REG_SZ /d %MOVETO%inetpub\wwwroot /f
reg add HKLM\Software\Microsoft\inetstp /v PathFTPRoot /t REG_SZ /d %MOVETO%inetpub\ftproot /f
REM Do the same for x64 directories
if not "%ProgramFiles(x86)%" == "" reg add HKLM\Software\Wow6432Node\Microsoft\inetstp /v PathWWWRoot /t REG_EXPAND_SZ /d %MOVETO%inetpub\wwwroot /f
if not "%ProgramFiles(x86)%" == "" reg add HKLM\Software\Wow6432Node\Microsoft\inetstp /v PathFTPRoot /t REG_EXPAND_SZ /d %MOVETO%inetpub\ftproot /f

REM Restart all IIS services
iisreset /start
echo.
echo.
echo ===============================================================================
echo Moved IIS7 root directory from %systemdrive%\ to %MOVETO%.
echo.
echo Please verify if the move worked. If so you can delete the %systemdrive%\inetpub directory.
echo If something went wrong you can restore the old settings via
echo     "APPCMD restore backup beforeRootMove"
echo and
echo     "REG delete HKLM\System\CurrentControlSet\Services\WAS\Parameters\ConfigIsolationPath"
echo You also have to reset the PathWWWRoot and PathFTPRoot registry values
echo in HKEY_LOCAL_MACHINE\Software\Microsoft\InetStp.
echo ===============================================================================
echo.
echo.
endlocal
goto success

REM error message if no argument or drive does not exist
:err
echo.
echo New root drive letter required.
echo Here an example how to move the IIS root to the F:\ drive:
echo.
echo MOVEIISROOT.BAT F
echo.
echo. 

:success

Or download the file
[wpdm_file id=11]