Wednesday, July 13, 2011

AD Migration moving data to a new server

During a Domain Migration you may want to move file data from an old server in the old domain to a new server in the new domain.

You can use robocopy http://sjmeyers.blogspot.com/2011/05/migrating-data-between-servers.html to migrate the data but you will still be left with old permissions.


You can run the Active Directory Migration Tool ADMT to do a security translation on the new server to change security on files and folders to the new domain.

Open ADMT Security Translation Wizard

Select Previously migrated objects


Select the old domain as the source and the new domain as the target


Select the computer(s)

Select Files and folders

Select Replace

Select Finish


 Run  pre-check and agent operation
Once Agent has run you can verify the logs


Then check file permissions have changed to the new Domain

Please note permissions will only be translated the the new Domain if the Group was previously migrated and has sid history.
In the example above the Domain users Group hasn't been migrated yet.

The Security Translation wizard can be run more than once on the same server. 

Wednesday, May 18, 2011

Adding a Printer with Group Policy Preferences

You can add printers using Group Policy Preferences which is new in Server 2008 provided you have the Group Policy Preference Client Side Extensions installed on the client machines.

Group Policy Preferences are added though the normal Group policy Console.



You can Create, Replace, Update, Delete as required. You can also set as the default printer.

 

If more granular control is required click the Common Tab.
You can apply the setting only once and use the Targeting Editor to get really specific

 

Tuesday, May 17, 2011

Migrating Data between Servers

Robocopy is a good option when migrating data to another server.

It has a number of switches that can preserve attributes, timestamps, security, owner info, auditing info, etc...
Also it can include, exclude, add attributes, rerun and much more.

For a full list of operations type robocopy /? at the command prompt.

I recently migrated data to a new server using the following...
robocopy source destination /E /DCOPY:T /PURGE /COPYALL /TEE /LOG+:c:\robocopylog.txt

/E :: copy subdirectories, including Empty ones.
/DCOPY:T :: COPY Directory Timestamps.
/PURGE :: delete dest files/dirs that no longer exist in source.
/COPYALL :: COPY ALL file info (Data, Attributes, Timestamp, Security, Owner, Auditing).
/TEE :: output to console window, as well as the log file.
/LOG+:file :: output status to LOG file (append to existing log).

The method I used was to copy the data over and checked that everything was OK.
I then disconnected the users on the source, reran the command, and pointed the users to the new location.

Using this method the second run only copied over the changes (and removed anything that was no longer there) so took alot less time than the first run.

Sunday, May 15, 2011

How to reclaim Disk Space using Vmware Thin provisioning

If your drive is thick provisioned
You will need to use either Vmware Tools, Shrink or sdelete
Vmware tools Shrink
 
Sdelete
 
Then migrate to a new datastore.
Note: there is currently an issue where you will need to migrate to a new datastore with different block size.

If your drive is already thin provisioned
Vmware Tools Shrink isn’t available.
You will need to use sdelete to zero out disk then migrate to new datastore.
Warning: using sdelete will expand the thin provisioned disk to it’s full provisioned size so make sure you have enough space on the datastore free.
Note: there is currently an issue where you will need to migrate to a new datastore with different block size.

Monday, April 4, 2011

VB Script to list the current logged in user

The Scipt below reads computers from c:\temp\computers.txt and lists the user who is currently logged in.

'List user currently logged on to a desktop

WScript.Echo "List Currently logged in user for Computers in c:\temp\computers.txt"
On Error Resume Next
Const ForReading = 1

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile ("c:\temp\computers.txt", ForReading)
strText = objTextFile.ReadAll
objTextFile.Close
arrComputers = Split(strText, VbCrLf)

For Each strComputer In arrComputers  
 Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
 Set colItems = objWMIService.ExecQuery("Select * from Win32_ComputerSystem",,48)
 For Each objItem in colItems
 WScript.Echo "UserName: " & objItem.UserName & " is logged in at computer " & strComputer
 Next
 Set objItem = Nothing: Set colItems = Nothing: Set objWMIService = Nothing
Next
WScript.Echo "Script Finished"

VB Script to Execute Wake on LAN on a different subnet

Wake on Lan packets won't travel over different subnets.

Below is a script which remotely executes the command on a host computer on the same subnet to send the WOL packet.

You will need
  • WOL capable computer you wish to wake.
  • A host machine on the same subnet as the comptuer you wish to wake.
  • WOL software http://sourceforge.net/projects/wake-on-lan/ extract the software to C:\temp\wol
  • MAC address of computer you wish to wake (you can get from DHCP) .
The script copies the WOL files from C:\temp\WOL to the host then remotely executes the command.

'Copy Wake on LAN files to remote computer then execute WOL
'Allows you to select remote computer on a different subnet as a host and wake another computerOption Explicit
Dim strHostComputer, strMAC, strIPComputer, objFSO
Dim objWMIService, objProcess, errReturn
Dim strComputerOn, Count, strCommand
Dim intProcessID, strComputer, colPingedComputers
Dim objComputer
strHostComputer =Inputbox("Wake Computer on another Subnet" & chr(10) & chr(13) & chr(10) & chr(13) & "Enter HOST PC Number on Remote Subnet","Input Required")
If strHostComputer = ""Then
 WScript.Echo"Host blank exiting script!"
 WScript.Quit
Endif
strMAC =Inputbox("Enter MAC of PC you want to WAKE" & chr(10) & chr(13) & chr(10) & chr(13) & "MAC can be obtained from DHCP Scope, Address Leases","Input Required")
If strMAC = ""Then
 WScript.Echo"MAC blank exiting script!"
 WScript.Quit
Endif
strIPComputer =Inputbox("Enter IP Address of Computer you want to WAKE","Input Required")
If strIPComputer = ""Then
 WScript.Echo"IP Blank will send request but can't check progress"
Endif

Const OverWriteFiles = TRUE
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists("C:\temp\WOL\bin\wol.exe") Then
    objFSO.CopyFolder"C:\temp\WOL" , "\\" & strHostComputer & "\C$\temp\WOL" , OverWriteFiles
Else
    Wscript.Echo"Wake on Lan File C:\temp\WOL\bin\wol.exe not found. Download from http://sourceforge.net/projects/wake-on-lan"
    WScript.Quit
EndIf


strCommand = "C:\temp\WOL\bin\wol.exe " & strMAC

Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strHostComputer & "\root\cimv2")
Set objProcess = objWMIService.Get("Win32_Process")

errReturn = objProcess.Create(strCommand, null, null, intProcessID)

If errReturn = 0Then
'WScript.Echo strHostComputer &" " & strCommand & " executed with a process ID: " & intProcessID
Else
WScript.Echo strHostComputer & " " & strCommand & " not started due to error: " & errReturn
EndIf
If strIPComputer = ""Then
 WScript.Quit
Endif
' Verify Computer Availability
Wscript.Echo"Waking Remote Computer - usually takes about 1 minute"
Count = 0
DoWhile strComputerOn <> 1
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colPingedComputers = objWMIService.ExecQuery _
    ("Select * from Win32_PingStatus Where Address = '" & strIPComputer & "'")
ForEach objComputerin colPingedComputers
    If objComputer.StatusCode = 0Then
        Wscript.Echo"Remote Computer " & strIPComputer & " Powered On!!!"
        strComputerOn=1
    Else
        WScript.sleep20000
        Count = Count + 1
        If Count = 7Then
        Wscript.Echo"Can't Connect to Remote Machine WOL has failed :(" & chr(10) & chr(13) & chr(10) & chr(13) & "Or Remote Machine has new IP"
        WScript.Quit
        Endif
   EndIf
Next
Loop

VB Script to Shutdown Comptuers from a text file

The below script Shuts down Computers in a text file C:\temp\computers.txt

' Read Arguments from a Text File

Const ForReading = 1
Set objDictionary = CreateObject("Scripting.Dictionary")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile("c:\temp\computers.txt", ForReading)
i = 0
WScript.Echo "SHUTDOWN Computers in c:\temp\computers.txt"
Do Until objTextFile.AtEndOfStream
    strNextLine = objTextFile.Readline
    objDictionary.Add i, strNextLine
    i = i + 1
Loop

For Each objItem in objDictionary
    Set objFSO = CreateObject("Scripting.FileSystemObject")
  If objFSO.FolderExists("\\"& objDictionary.Item(objItem) & "\Admin$") Then
      Set objFolder = objFSO.GetFolder("\\" & objDictionary.Item(objItem) & "\Admin$")
      'Reboot Desktops
      'strComputer = objDictionary.Item(objItem)
      WScript.Echo objDictionary.Item(objItem)
    Set objWMIService = GetObject("winmgmts:" _
        & "{impersonationLevel=impersonate,(Shutdown)}\\" & _
           objDictionary.Item(objItem) & "\root\cimv2")

    Set colOperatingSystems = objWMIService.ExecQuery _
        ("Select * from Win32_OperatingSystem")

    For Each objOperatingSystem in colOperatingSystems
        objOperatingSystem.Win32Shutdown(1)
    Next
    
      Else
      'WScript.Echo "Can't Connect to " & objDictionary.Item(objItem) & chr(10) & chr(13) & "Please verify it is contactable via DNS and you have Admin rights"
      'strCantConnect = "1"
  End If
Next
If strCantConnect = "1" Then
WScript.Echo "Script Finished!"
Else WScript.Echo "All Desktops have been Shutdown!"
End if

VB Script to Set the Default Domain for Computers in a text file

The following script Sets the Default Domain at login for computers in C:\temp\computers.txt

' Change Registry Keys so the default domain name is BOB when  people login
Const HKEY_LOCAL_MACHINE = &H80000002

' Read Arguments from a Text File
Const ForReading = 1

Set objDictionary = CreateObject("Scripting.Dictionary")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile("c:\temp\computers.txt", ForReading)
i = 0
WScript.Echo "Set Login Domain to BOB Computers in c:\temp\computers.txt"
Do Until objTextFile.AtEndOfStream
    strNextLine = objTextFile.Readline
    objDictionary.Add i, strNextLine
    i = i + 1
Loop

For Each objItem in objDictionary
    Set objFSO = CreateObject("Scripting.FileSystemObject")
 
      WScript.Echo objDictionary.Item(objItem)
      strComputer = objDictionary.Item(objItem)

Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
    strComputer & "\root\default:StdRegProv")

strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
strValueName = "DefaultDomainName"
strValue = "BOB"
oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue

strValueName = "CachePrimaryDomain"
strValue = "BOB"
oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue

Next
If strCantConnect = "1" Then
WScript.Echo "Script Finished!"
Else WScript.Echo "All Desktops have had Default Domain Set!"
End if 

VB Script to Reboot Computers from a text file

The VB Script below reboots machines in C:\temp\computers.txt

' Read Arguments from a Text File

Const ForReading = 1
Set objDictionary = CreateObject("Scripting.Dictionary")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile("c:\temp\computers.txt", ForReading)
i = 0
WScript.Echo "Reboot Computers in c:\temp\computers.txt"
Do Until objTextFile.AtEndOfStream
    strNextLine = objTextFile.Readline
    objDictionary.Add i, strNextLine
    i = i + 1
Loop

For Each objItem in objDictionary
    Set objFSO = CreateObject("Scripting.FileSystemObject")
  If objFSO.FolderExists("\\"& objDictionary.Item(objItem) & "\Admin$") Then
      Set objFolder = objFSO.GetFolder("\\" & objDictionary.Item(objItem) & "\Admin$")
      'Reboot Desktops
      'strComputer = objDictionary.Item(objItem)
      WScript.Echo objDictionary.Item(objItem)
    Set objWMIService = GetObject("winmgmts:" _
        & "{impersonationLevel=impersonate,(Shutdown)}!\\" & _
           objDictionary.Item(objItem) & "\root\cimv2")

    Set colOperatingSystems = objWMIService.ExecQuery _
        ("Select * from Win32_OperatingSystem")

    For Each objOperatingSystem in colOperatingSystems
        objOperatingSystem.Reboot()
    Next
    
      Else
      WScript.Echo "Can't Connect to " & objDictionary.Item(objItem) & chr(10) & chr(13) & "Please verify it is contactable via DNS and you have Admin rights"
      strCantConnect = "1"
  End If
Next
If strCantConnect = "1" Then
WScript.Echo "Script Finished!"
Else WScript.Echo "All Desktops have been Rebooted!"
End if

VB Script to get IP and MAC from remote computer

The following script gets the IP and MAC address form computers in C:\temp\computers.txt and writes them to files in C:\temp\desktop

'Gathers the IP address and MAC from
'Computers in c:\temp\computers.txt
'Outputs to c:\temp\desktop

Option Explicit
Dim objDictionary, objFSO, objTextFile, strRemoteComputer
Dim strNextLine, arrServiceList, i, strCantConnect, strLogFileLocation
Dim objFile, objFolder, objTextFile1, n, objWMIService, colAdapters, objAdapter

' Read a Text File into an Array
Const ForAppending = 8
Const ForReading = 1
Set objDictionary = CreateObject("Scripting.Dictionary")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile _
    ("c:\temp\computers.txt", ForReading)

Do Until objTextFile.AtEndOfStream
    strNextLine = objTextFile.Readline
    arrServiceList = Split(strNextLine , ",")
    'Wscript.Echo "Server name: " & arrServiceList(0)
    For i = 1 to Ubound(arrServiceList)
        Wscript.Echo "Service: " & arrServiceList(i)
    Next

'Get Computer name via input
'strComputer =Inputbox("Get MAC Address and write to c:\Temp" & chr(10) & chr(13) & chr(10) & chr(13) & "Enter PC Number","Input Required")

 ' Verify connection to the Desktop
 strCantConnect = "0"
 Set objFSO = CreateObject("Scripting.FileSystemObject")
  If objFSO.FolderExists("\\"& arrServiceList(0) & "\Admin$") Then
      Set objFolder = objFSO.GetFolder("\\" & arrServiceList(0) & "\Admin$")
  Else
      WScript.Echo "Can't Connect to " & arrServiceList(0) & chr(10) & chr(13) & "Please verify it is contactable via DNS and you have Admin rights"
      strCantConnect = "1"
  End If
' Create the File System Object
strLogFileLocation = "C:\Temp\Desktop\" & arrServiceList(0) & ".txt"
' Create the File System Object
Set objFSO = CreateObject("Scripting.FileSystemObject")

If objFSO.FileExists(strLogFileLocation) Then
 'objFSO.DeleteFile(strLogFileLocation)
 'Set objFile = objFSO.CreateTextFile(strLogFileLocation)
Else
   Set objFile = objFSO.CreateTextFile(strLogFileLocation)
End If
set objFile = nothing
set objFolder = nothing
' OpenTextFile Method needs a Const value
' ForAppending = 8 ForReading = 1, ForWriting = 2
If strCantConnect = "0" Then
Set objTextFile1 = objFSO.OpenTextFile _
(strLogFileLocation, ForAppending, True)
objTextFile1.WriteLine()
objTextFile1.WriteLine("#################################################################################")
End if

'Set objFSO = CreateObject("Scripting.FileSystemObject")
'Set objFile = objFSO.CreateTextFile(strLogFileLocation)

' List IP Configuration Data
strRemoteComputer = arrServiceList(0)
If strCantConnect = "0" Then
 Set objWMIService = GetObject("winmgmts:" _
     & "{impersonationLevel=impersonate}!\\" & strRemoteComputer & "\root\cimv2")

 Set colAdapters = objWMIService.ExecQuery _
     ("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")
 n = 1
 End If
   
 For Each objAdapter in colAdapters
If strCantConnect = "0"  Then
 '   WScript.Echo "Network Adapter " & n
 objTextFile1.WriteLine("=================")
 objTextFile1.WriteLine("Host name: " & objAdapter.DNSHostName)
 objTextFile1.WriteLine("Description: " & objAdapter.Description)
 objTextFile1.WriteLine("Physical (MAC) address: " & objAdapter.MACAddress)

  Else
  End If 
    If Not IsNull(objAdapter.IPAddress) Then
       For i = 0 To UBound(objAdapter.IPAddress)
  If strCantConnect = "0" Then
  objTextFile1.WriteLine("IP address:             " & objAdapter.IPAddress(i))
  objTextFile1.WriteLine()
  End if
       Next
    End If

    n = n + 1
  
Next
objTextFile1.Close
If strCantConnect = "0" Then
'WScript.Echo "Please review " & strLogFileLocation & " for MAC Address"
Else
End If
'

Loop
WScript.Echo "Script Finished! Please Review c:\Temp\Desktop for results"

VBScript to Set DNS Suffix, Check File, Check Registry

The below script...
  • Reads computer names from c:\temp\compters.txt
  • Sets the DNS suffix to append under Advanced TCP/IP properties 
  • Verifies a file exists C:\Temp\efs_found.txt and the file size is 0
  • Checks a registry entry

'Check Computers in c:\temp\computers.txt
'Set DNS suffix
'Check a file exists and the file size
'Check Registry setting

Option Explicit
Dim objFSO, objTextFile, strNextLine, strCantConnect, arrServiceList
Dim objFolder, strKeyPath, strValueName, strValue, oReg, i, objFile

' Read a Text File into an Array
Const HKEY_LOCAL_MACHINE = &H80000002
Const ForReading = 1

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile _
    ("c:\temp\computers.txt", ForReading)
WScript.Echo "Setting DNS Suffix, Checking Encypted Files, Checking ODBC on C:\Temp\Computers.txt"
Do Until objTextFile.AtEndOfStream
    strNextLine = objTextFile.Readline
    arrServiceList = Split(strNextLine , ",")
    'Wscript.Echo "Server name: " & arrServiceList(0)
    strCantConnect = "0"
  ' Verify connection to the Desktop
 Set objFSO = CreateObject("Scripting.FileSystemObject")
  If objFSO.FolderExists("\\" & arrServiceList(0) & "\Admin$") Then
      Set objFolder = objFSO.GetFolder("\\" & arrServiceList(0) & "\Admin$")
  Else
      WScript.Echo "Can't Connect to " & arrServiceList(0) & chr(10) & chr(13) & "Please verify it is contactable via DNS and you have Admin rights"
      strCantConnect = "1"
  End If
 
 ' Create Registry DNS Search String Value
 If  strCantConnect = "0" Then
 Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
    arrServiceList(0) & "\root\default:StdRegProv")
  strKeyPath = "SYSTEM\CurrentControlSet\services\Tcpip\Parameters"
 strValueName = "SearchList"
 strValue = "contoso,contoso.local"
 oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
 'WScript.Echo "DNS Search Domains Added to "& arrServiceList(0) & " Registry"
 Else
 End If

 ' Verify that the EFS checking script
has been run
 Set objFSO = CreateObject("Scripting.FileSystemObject")
 If objFSO.FileExists("\\" &  arrServiceList(0) & "\C$\Temp\efs_found.txt") Then
  Set objFSO = CreateObject("Scripting.FileSystemObject")
  Set objFile = objFSO.GetFile("\\"  & arrServiceList(0) & "\C$\Temp\efs_found.txt")
   If objFile.Size = "0" Then
   'WScript.Echo "No encypted Files Exist on "  & arrServiceList(0)
   Else
   WScript.Echo "Encypted Files Exist on "  & arrServiceList(0) & " Unencrypt before Migrating!"
   End If
 Else
 If  strCantConnect = "0" Then
    Wscript.Echo "Script for checking for Encryption Files hasn't been run."& chr(10) & chr(13) & "Login to "  & arrServiceList(0) & "and run
FindEFS.bat"& chr(10) & chr(13) & "Before continuing!"
 End If
  End If
 ' Check ODBC settings for Dataworks
 If  strCantConnect = "0" Then
  Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
     arrServiceList(0) & "\root\default:StdRegProv")
   strKeyPath = "SOFTWARE\ODBC\ODBC.INI\DataWorks"
  strValueName = "Trusted_Connection"
  oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
 If strValue = "Yes" Then
  WScript.Echo "Dataworks ODBC Settings NOT SET CORRECTLY on "  & arrServiceList(0) &"!"
  Else
     'Wscript.Echo "Dataworks ODBC Settings look OK on "  & arrServiceList(0)
     End If 
    End if
        For i = 1 to Ubound(arrServiceList)
        Wscript.Echo "Service: " & arrServiceList(i)

    Next
Loop
Wscript.Echo "Finished Checking and setting DNS!"

Sunday, April 3, 2011

VB Script for checking computers in a text file are turned on

Below is a handy script for checking Pc's in a text file are turned on and you can connect to the Admin share. 

'Check Computers in c:\temp\computers.txt are turned on
'And you can access admin share

Option Explicit
Dim objDictionary, objFSO, objTextFile, i, strNextLine
Dim objItem, objFolder, strCantConnect

' Read Arguments from a Text File
Const ForReading = 1

Set objDictionary = CreateObject("Scripting.Dictionary")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile("c:\temp\computers.txt", ForReading)
i = 0
WScript.Echo "Verify you can connect to Computers in c:\temp\computers.txt"
Do Until objTextFile.AtEndOfStream
    strNextLine = objTextFile.Readline
    objDictionary.Add i, strNextLine
    i = i + 1
Loop

For Each objItem in objDictionary
    Set objFSO = CreateObject("Scripting.FileSystemObject")
  If objFSO.FolderExists("\\"& objDictionary.Item(objItem) & "\Admin$") Then
      Set objFolder = objFSO.GetFolder("\\" & objDictionary.Item(objItem) & "\Admin$")
  Else
      WScript.Echo "Can't Connect to " & objDictionary.Item(objItem) & chr(10) & chr(13) & "Please verify it is contactable via DNS and you have Admin rights"
      strCantConnect = "1"
  End If
Next
If strCantConnect = "1" Then
WScript.Echo "Script Finished!"
Else WScript.Echo "All Desktops are Switched on!"
End if

Wednesday, March 9, 2011

Change the root password of ESXi

You can change the root password of a ESXi 4.1 box by using the local console or by using vSphere CLI.

Below is how you do it via CLI...

C:\Program Files (x86)\VMware\VMware vSphere CLI\bin>vicfg-user.pl --server yourservername.domain -e user -o modify -l root -p newpassword

Sunday, January 30, 2011

Add a user to the Domain using dsadd

Use the following to add a new user to the Domain

dsadd user "CN=the_username,OU=the_ou,DC=the_sub_domain,DC=the_tl_domain" -pwd the_password -upn the_username -display the_displayname -desc "The Description" -mustchpwd no -pwdneverexpires yes

Thursday, January 13, 2011

Configuring SNMP on ESXi

ESXi SNMP Setup
SNMP Setup for ESXi must be configured using the Vsphere Command line Interface.
http://www.vmware.com/support/developer/vcli/
Configure SNMP Community.
vicfg-snmp.pl --server esxi_servername.domain -c community_name
Set  the Target Trap address
vicfg-snmp.pl --server esxi_servername.domain -t trap_server_ip/community_name
Enable SNMP
vicfg-snmp.pl --server esxi_servername.domain --enable
View SNMP Setup
vicfg-snmp.pl --server esxi_servername.domain  --show

Install ESXi 4.1 from USB Drive

Have just installed ESXi 4.1 from a USB drive onto an IBM x3550 M3.

Below is the process I followed....

Format your USB drive FAT32

Download UNetbootin http://unetbootin.sourceforge.net/ which makes bootable Linux based USB drives.

Run UNetbootin, Select the ESXI 4.1 iso image and your USB drive, Click OK


Click Yes to overwrite


Click Exit.

From here I followed the following blog http://www.ivobeerens.nl/?p=699

Edit syslinux.cfg file to add ks=usb and --- modtgz.

append vmkboot.gz ks=usb --- vmkernel.gz --- sys.vgz --- cim.vgz --- ienviron.vgz --- install.vgz --- mod.tgz



Then create a file called  ks.cfg and add below.

More commands for scripted installtion can be found here http://www.vmware.com/pdf/vsphere4/r41/vsp_41_esxi_i_vc_setup_guide.pdf.
Below config asks if you want to use DHCP before installing ESXi.
If you choose to add network settings then a machine may boot with USB and install ESXi without any prompts.

 
# Accept the VMware End User License Agreement
vmaccepteula
# Set the root password for the DCUI and Tech Support Mode
rootpw password
# Choose the first discovered disk to install onto
autopart --firstdisk --overwritevmfs
# The installation media is in the USB drive
install usb
reboot


Download Ivo's mod.tgz file and copy it to the root of your USB drive.http://www.ivobeerens.nl/wp-content/uploads/mod.tgz

You should now be good to go.

Warning ESXi will install on the first discovered disk make sure your Server isn't connected to any drives or  SAN Luns that you don't want blown away.

Thursday, January 6, 2011

Vmware Cold Clone from USB

Below is one way you can cold clone  a server via USB. Not pretty but it works....

Install  BartPE http://www.nu2.nu/pebuilder/

Follow instructions here to created a USB Bootable version of BartPE http://www.911cd.net/forums/index.php?showtopic=10806

Take a copy of the coldclone.iso  - rename it to bartpe.iso and copy to your USB drive overwriting the original bartpe.iso

Image Backup of USB Drive

Found a great tool for creating and restoring images to a USB drive called "USB Image Tool".

Creates a full backup of your USB drive along with file system format - very handy if your making bootable USB images.

http://www.alexpage.de/