Tuesday, August 23, 2016

Use the System File Checker tool to repair missing or corrupted system files

Use the System File Checker tool to repair missing or corrupted system files

System File Checker is a utility in Windows that allows users to scan for corruptions in Windows system files and restore corrupted files. This article describes how to run the System File Checker tool (SFC.exe) to scan your system files and to repair missing or corrupted system files. If a Windows Resource Protection (WRP) file is missing or is corrupted, Windows may not behave as expected. For example, some Windows functions may not work, or Windows may crash.

Run the System File Checker tool (SFC.exe)
 
To do this, follow these steps:Open an elevated command prompt. To do this, do the following as your appropriate:
Windows 8.1 or Windows 8
Swipe in from the right edge of the screen, and then tap Search. Or, if you are using a mouse, point to the lower-right corner of the screen, and then click Search. Type Command Prompt in the Search box, right-click Command Prompt, and then click Run as administrator. If you are prompted for an administrator password or for a confirmation, type the password, or click Allow.
A screenshot for this step.
Windows 10, Windows 7, or Windows VistaTo do this, click Start, type Command Prompt or cmd in the Search box, right-click Command Prompt, and then click Run as administrator. If you are prompted for an administrator password or for a confirmation, type the password, or click Allow.

A screenshot for this step.

  1. At the command prompt, type the following command, and then press ENTER:
    sfc /scannow
    A screenshot for this step.

    The sfc /scannow command will scan all protected system files, and replace corrupted files with a cached copy that is located in a compressed folder at %WinDir%\System32\dllcache.
    The %WinDir% placeholder represents the Windows operating system folder. For example, C:\Windows.

    Note Do not close this Command Prompt window until the verification is 100% complete. The scan results will be shown after this process is finished.
  2. After the process is finished, you may receive one of the following messages:
    • Windows Resource Protection did not find any integrity violations.

      This means that you do not have any missing or corrupted system files.
    • Windows Resource Protection could not perform the requested operation.

      To resolve this problem, perform the System File Checker scan in safe mode, and make sure that the PendingDeletes and PendingRenames folders exist under %WinDir%\WinSxS\Temp.
    • Windows Resource Protection found corrupt files and successfully repaired them. Details are included in the CBS.Log %WinDir%\Logs\CBS\CBS.log.

      To view the detail information about the system file scan and restoration, go to How to view details of the System File Checker process.
    • Windows Resource Protection found corrupt files but was unable to fix some of them. Details are included in the CBS.Log %WinDir%\Logs\CBS\CBS.log.
 
How to manually replace a corrupted system file with a known good copy of the file
 After you determine which system file was corrupted and could not be repaired through the detail information in the Sfcdetails.txt file, find where the corrupted file located, and then manually replace the corrupted file with a known good copy of the file. To do this, follow these steps:

Note You may be able to get a known good copy of the system file from another computer that is running the same version of Windows with your computer. You may perform a System File Checker process on that computer to make sure the system file that you intend to copy is a good copy.
  1. Take administrative ownership of the corrupted system file. To do this, at an elevated command prompt, copy and then paste (or type) the following command, and then press ENTER:
    takeown /f Path_And_File_Name
    Note The Path_And_File_Name placeholder represents the path and the file name of the corrupted file. For example, type takeown /f C:\windows\system32\jscript.dll. A screenshot for this step.
  2. Grant administrators full access to the corrupted system file. To do this, copy and paste (or type) the following command, and then press ENTER:
    icacls Path_And_File_Name /GRANT ADMINISTRATORS:F
    Note The Path_And_File_Name placeholder represents the path and the file name of the corrupted file. For example, type icacls C:\windows\system32\jscript.dll /grant administrators:F.A screenshot for this step.
  3. Replace the corrupted system file with a known good copy of the file. To do this, copy and paste (or type) the following command, and then press ENTER:
    Copy Source_File Destination
    Note The Source_File placeholder represents the path and file name of the known good copy of the file on your computer, and the Destination placeholder represents the path and file name of the corrupted file. For example, type copy E:\temp\jscript.dll C:\windows\system32\jscript.dll
 

VMware memory counters

<![if !supportTabStrip]>
https://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/memory_counters.html

VMware network adapters

Network adapter choices depend on the version number and the guest operating system running on the virtual machine. This article discusses the different network adapter options available for virtual machines.
There are three types of networking available to virtual machines. Each type has its own uses, behaviors and features:

Bridged networking

  • Used in environments where virtual machines provide services or participate in a real network.
  • Connects virtual machines to the Local Area Network (LAN) of their host machine, whether wired or wireless, and allows them to connect to any other host or virtual machines (if they are also bridged) on the network.
  • Connects the virtual network adapter in a virtual machine to the physical Ethernet adapter in its host machine.
  • You can establish additional virtual bridges to use in custom configurations that require connections to more than one physical Ethernet adapter on the host computer.
  • The default network adapter interface is vmnet0.

Host-only networking

  • Used in isolated test environments where virtual machines do not need to communicate with other environments.
  • Connects virtual machines to a private LAN shared only by their host machine and any other virtual machines also using host-only networking.
  • Other host machines on the host LAN cannot communicate with the virtual machines.
  • The default network adapter interface is vmnet1.

Network Address Translation (NAT) networking

  • Used in environments where virtual machines do not provide services but still need to access a network.
  • Connects virtual machines to an external network using the host machines IP address for external communication.
  • Connects virtual machines to the Internet through their host machines dial-up connection, Ethernet adapter or wireless Ethernet adapter.
  • Connects virtual machines to a non-Ethernet network, such as Token Ring or ATM.
  • Establishes a private LAN shared only by your host machine and any other virtual machines also using NAT networking.
  • Other host machines on the host LAN communicate with the virtual machines, however external host machines cannot initiate communication with virtual machines unless NAT port forwarding is also in use. NAT port forwarding causes network traffic destined for a port on a host machine to be forwarded to a specific port on a virtual machine.
  • The default network adapter interface is vmnet8.
 
Available Network Adapters
Only those network adapters that are appropriate for the virtual machine you are creating are available configuration options in the Choose Networks window.
  • Vlance: This is an emulated version of the AMD 79C970 PCnet32- LANCE NIC, and it is an older 10 Mbps NIC with drivers available in most 32-bit guest operating systems except Windows Vista and later. A virtual machine configured with this network adapter can use its network immediately.
  • VMXNET: The VMXNET virtual network adapter has no physical counterpart. VMXNET is optimized for performance in a virtual machine. Because operating system vendors do not provide built-in drivers for this card, you must install VMware Tools to have a driver for the VMXNET network adapter available.
  • Flexible: The Flexible network adapter identifies itself as a Vlance adapter when a virtual machine boots, but initializes itself and functions as either a Vlance or a VMXNET adapter, depending on which driver initializes it. With VMware Tools installed, the VMXNET driver changes the Vlance adapter to the higher performance VMXNET adapter.
  • E1000: An emulated version of the Intel 82545EM Gigabit Ethernet NIC. A driver for this NIC is not included with all guest operating systems. Typically Linux versions 2.4.19 and later, Windows XP Professional x64 Edition and later, and Windows Server 2003 (32-bit) and later include the E1000 driver.

    Note: E1000 does not support jumbo frames prior to ESXi/ESX 4.1.
  • E1000e: This feature emulates a newer model of Intel Gigabit NIC (number 82574) in the virtual hardware. This is known as the "e1000e" vNIC. e1000e is available only on hardware version 8 (and newer) virtual machines in vSphere 5. It is the default vNIC for Windows 8 and newer (Windows) guest operating systems. For Linux guests, e1000e is not available from the UI (e1000, flexible vmxnet, enhanced vmxnet, and vmxnet3 are available for Linux).
  • VMXNET 2 (Enhanced): The VMXNET 2 adapter is based on the VMXNET adapter but provides some high-performance features commonly used on modern networks, such as jumbo frames and hardware offloads. This virtual network adapter is available only for some guest operating systems on ESXi/ESX 3.5 and later. Because operating system vendors do not provide built-in drivers for this card, you must install VMware Tools to have a driver for the VMXNET 2 network adapter available.

    VMXNET 2 is supported only for a limited set of guest operating systems.

    Notes:
    • You can use enhanced VMXNET adapters with other versions of the Microsoft Windows 2003 operating system, but a workaround is required to enable the option in the VMware Infrastructure (VI) Client or vSphere Client.
    • Jumbo frames are not supported in the Solaris Guest OS for VMXNET 2.
  • VMXNET 3: The VMXNET 3 adapter is the next generation of a paravirtualized NIC designed for performance, and is not related to VMXNET or VMXNET 2. It offers all the features available in VMXNET 2, and adds several new features like multiqueue support (also known as Receive Side Scaling in Windows), IPv6 offloads, and MSI/MSI-X interrupt delivery.

Wednesday, August 17, 2016

vmnics device eth0 does not seem to be present, delaying initializing

https://communities.vmware.com/thread/55651?start=0&tstart=0


Install vmware tool , if updated install it again

service network stop
rm /etc/udev/rules.d/70-persistent-net.rules

Then remove the HWADDRESS from the ifcfg-ethX file all together
start_udev
service network start

Thursday, August 11, 2016

How to generate a complete crash dump in windows

How to generate a complete crash dump file or a kernel crash dump file by using an NMI on a Windows-based system

 How to generate a memory dump file when a server stops responding (hangs)

This method does not work for all systems. For example, Hewlett-Packard (HP) BladeSystem servers from the Hewlett-Packard Development Company are managed through a browser-based graphical user interface (GUI). A keyboard is not attached to the HP BladeSystem server. Therefore, you cannot use this keyboard shortcut to generate a crash dump file. In these cases, you must generate a complete crash dump file or a kernel crash dump file by using the Non-Maskable Interrupt (NMI) switch that causes an NMI on the system processor. This article describes how to generate a complete crash dump file or a kernel crash dump file by using an NMI switch.
Before you continue, look in the hardware BIOS reference manual or contact your hardware vendor to determine whether the server is equipped with an NMI switch. To enable complete memory dump files on your server, follow these steps:
  1. Set up the page file to generate a complete memory dump file.T
  2. Right-click My Computer, and then click Properties.
  3. Click the Advanced tab.
  4. Under Startup and Recovery, click Settings.
  5. Make sure that Kernel memory dump or Complete memory dump is selected under Writing Debugging Information.
  6. You can change the location of the memory dump file to a different local partition if you do not have sufficient room on the partition where the operating system is installed.
  7. "Kernel Memory Dump" is displayed in Startup and Recovery, but a complete memory dump is performed in Windows 2000 or in Windows Server 2003
  8. In Registry Editor, locate the following registry subkey:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CrashControl
  9. Right-click CrashControl, point to New, and then click DWORD Value.
  10. Type NMICrashDump, and then press ENTER.
  11. Right-click NMICrashDump, and then click Modify.
  12. In the Value data box, type 1, and then click OK.
  13. Restart the computer.
  14. Hardware vendors, such as HP, IBM, and Dell, may provide an Automatic System Recovery (ASR) feature. You should disable this feature during troubleshooting. For example, if HP and Compaq's ASR feature is enabled in the BIOS, disable this feature while you are troubleshooting to generate a complete memory.dmp file. For the exact steps, contact your hardware vendor.
  15. Enable the NMI switch in the BIOS or by using the Integrated Lights Out (iLO) Web interface.

    Note For the exact steps, see the BIOS reference manual or contact your hardware vendor.
  16. Test this method on the server by using the NMI switch to generate a dump file. You will see a STOP 0x00000080 hardware malfunction.
  17. Wait for the problem to recur.
For information about how to contact your hardware vendor, visit the following Microsoft Web site:

Monday, August 1, 2016

How to find vCenter info of a vm if you lost the records

clear
Add-PSSnapin VMware.VimAutomation.Core
$Admin ="tech-jockey\admin"
$Password = Get-Content c:\vccred\credential\cred.txt | convertto-securestring
$Credential = new-object -typename System.Management.Automation.PSCredential -argumentlist $Admin, $Password

$vc="vc1-name","vc2-name","vc3-name","vc4-name" # if you have 100 vc put those names here

foreach($item in $vc)
{
Connect-VIServer $item -SaveCredentials -Credential $Credential
}
clear
$inpt= Read-Host "Enter vm name to search:"
$vmm=get-vm $inpt.ToString()
$ht= Get-VMHost -name $vmm.Host
$silo= Get-Cluster -name $ht.parent
$srvid=$silo.Client.ServerUri
$len= $srvid.length -4
echo "VM Name"
echo $vmm.name
echo "======================"
echo "Esxi Host Name"
echo $vmm.host.Name
echo "======================"
echo "vCenter Name"
echo $srvid.Substring(4,$len)

Content of this blog has been moved to GITHUB

Looking at current trends and to make my content more reachable to people, I am moving all the content of my blog https://tech-jockey.blogsp...