I created a service account that only has read permission to the \\sccmserver\sms_sitecode\client share on the SCCM server. The client is installed from this location to ensure that we are always using the latest version and get rid of any need to manually copy files or put it in the template.
1. Make sure that you have your customization spec configured to log in once as administrator:

2. Add the following lines to you customization spec.
cmd.exe /c net use i: \\sccmserver\SMS_sitecode\Client /user:username password cmd.exe /c i:\ccmsetup.exe <options> timeout 60 cmd.exe /c shutdown -r -t 00
This maps a drive to your SCCM share using the service account, installs the client, and then reboots the virtual machine. I put a timeout (sleep) for 60 seconds in there to make sure the install has time to do what it needs to do and it is working well at this point.
3. Once the VM is created and customized and rebooted you should have a service ‘SMS Agent’ started (Automatic Delayed Start).
]]>
VM/ Physical – It is recommended to have the time server as a physical server, but VMs should be okay depending on your setup and requirement. My virtual lab environment is VMware based so here’s the guide for a VM. Once the CentOS Minimal is installed on the VM make sure to install open-vm-tools.
yum install open-vm-tools
If you are not conformable with Vi Editor please use install nano for editing.
yum install nano
[root@mytimesrv01 ~]# yum -y install ntp
[root@mytimesrv01 ~]# vi /etc/ntp.conf # For more information about this file, see the man pages # ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5). driftfile /var/lib/ntp/drift # Permit time synchronization with our time source, but do not # permit the source to query or modify the service on this system. restrict default nomodify notrap nopeer noquery # Permit all access over the loopback interface. This could # be tightened as well, but to do so would effect some of # the administrative functions. restrict 127.0.0.1 restrict ::1 # Hosts on local network are less restricted. #restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap # Use public servers from the pool.ntp.org project. # Please consider joining the pool (http://www.pool.ntp.org/join.html). #Your time servers go here: server 0.us.pool.ntp.org iburst server 1.us.pool.ntp.org iburst server 2.us.pool.ntp.org iburst server 3.us.pool.ntp.org iburst #Default OOB time servers #server 0.centos.pool.ntp.org iburst #server 1.centos.pool.ntp.org iburst #server 2.centos.pool.ntp.org iburst #server 3.centos.pool.ntp.org iburst #broadcast 192.168.1.255 autokey # broadcast server #broadcastclient # broadcast client #broadcast 224.0.1.1 autokey # multicast server #multicastclient 224.0.1.1 # multicast client #manycastserver 239.255.254.254 # manycast server #manycastclient 239.255.254.254 autokey # manycast client # Enable public key cryptography. #crypto includefile /etc/ntp/crypto/pw # Key file containing the keys and key identifiers used when operating # with symmetric key cryptography. keys /etc/ntp/keys # Specify the key identifiers which are trusted. #trustedkey 4 8 42 # Specify the key identifier to use with the ntpdc utility. #requestkey 8 # Specify the key identifier to use with the ntpq utility. #controlkey 8 # Enable writing of statistics records. #statistics clockstats cryptostats loopstats peerstats # Disable the monitoring facility to prevent amplification attacks using ntpdc # monlist command when default restrict does not include the noquery flag. See # CVE-2013-5211 for more details. # Note: Monitoring will not be disabled with the limited restriction flag. disable monitor logfile /var/log/ntp.log
[root@mytimesrv01 ~]# systemctl start ntpd [root@mytimesrv01 ~]# systemctl enable ntpd
[root@mytimesrv01 ~]# firewall-cmd –add-service=ntp –permanent success [root@mytimesrv01 ~]# firewall-cmd –reload success
[root@mytimesrv01 ~]# ntpq -p
Your output should be similar to:

This applies to ESX4/5.x/6.x
For the restart of the management agents (mgmt-vmware and vmware-vpxa) do the following:
Log in to SSH or Local console as root.
Run these commands:
/etc/init.d/hostd restart /etc/init.d/vpxa restart
Or also (alternative way)
To reset the management network on a specific VMkernel interface, by default vmk0, run the command:
esxcli network ip interface set -e false -i vmk0; esxcli network ip interface set -e true -i vmk0
[su_note note_color=”#fafae8″]Note: Using a semicolon (;) between the two commands ensures the VMkernel interface is disabled and then re-enabled in succession. If the management interface is not running on vmk0, change the above command according to the VMkernel interface used.[/su_note]
to restart all management agents on the host, run the command:
services.sh restart
1.) Connect to the console of your ESX Server and press F2
2.) Login as root and when using the Up/Down arrows navigate to Restart Management Agents.
3.) Press Enter and press F11 to restart the services.
4.) When the service has been restarted, press Enter. Then you can press Esc to logout of the system.
Screen should be similar to:

/sbin/services.sh restart
You can also check:Â Â Service mgmt-vmware restart may not restart hostd (1005566).
Successful output :
Stopping vmware-vpxa: [ OK ] Starting vmware-vpxa: [ OK ]
This may also server as a solution for the error “Unable to access file since it is locked. An error occurred while consolidating disks: One or more disks are busy.â€
]]>This article shows you how configure SNMP on an ESXi host manually, via PowerCLI and via host profiles.
This is the most boring approach and should really only be used if you only have a few ESXi hosts to do, or if you really like doing things manually 
esxcli system snmp set --communities esxcli system snmp set --targets esxcli system snmp set --enable true esxcli network firewall ruleset set --ruleset-id snmp --allowed-all true esxcli network firewall ruleset set --ruleset-id snmp --enabled true /etc/init.d/snmpd restart
Note 1: Replace <COMMUNITY_STRING> with the community string for your monitoring solution.
Note 2: Replace <TARGET_STRING> with the target string that maps to your environment, in the format of target_address@port/community_string.
Option number 2 is to use PowerCLI to configure SNMP on an ESXi host. The following script is how to do this on a single host. To configure SNMP on an whole bunch of ESXi hosts, see option 3 below.
#Script Variables $sESXiHost = '' $sCommunity = '' $sTarget = '' $sPort = '' #Connect to ESXi host Connect-VIServer -Server $sESXiHost #Clear SNMP Settings Get-VMHostSnmp | Set-VMHostSnmp -ReadonlyCommunity @() #Add SNMP Settings Get-VMHostSnmp | Set-VMHostSnmp -Enabled:$true -AddTarget -TargetCommunity $sCommunity -TargetHost $sTarget -TargetPort $sPort -ReadOnlyCommunity $sCommunity #Get SNMP Settings $Cmd= Get-EsxCli -VMHost $sESXiHost $Cmd.System.Snmp.Get()
Note: Prior to being able to use the script above, ensure you configure the following variable values:
<ESXI_HOST> – The FQDN or the IP address of the ESXi host you want to enable SNMP on.<COMMUNITY> – This is the community string you require for your environment (same as in option 1 above).<TARGET> – This is the FQDN or IP address of the target you want to send the SNMP traps to. Note: THIS IS NOT A TARGET STRING as in option 1. In this instance you ONLY need the FQDN or IP address. The @port and the community_string will be added automatically by the Set-VMHostSnmp cmdlet.<PORT> – The port you require SNMP traps to be sent on.If you have to configure SNMP for more than just a handful of ESXi hosts, then it is worth automating the entire process through a PowerCLI script. The logic around enabling SNMP on the ESXi host is the same as in option 2 above, with some additional logic around this to enumerate and complete the process on all ESXi Hosts.
Here is a script that will connect to a vCenter Server, get a list of all ESXi Hosts and then configure SNMP on each ESXi host:
#requires -version 4
<#
.SYNOPSIS
Configure SNMP Settings on ESXi Hosts
.DESCRIPTION
Connect to vCenter Server and configure all ESXi hosts with SNMP settings
.PARAMETER None
.INPUTS Server
Mandatory. The vCenter Server or ESXi Host the script will connect to, in the format of IP address or FQDN.
.INPUTS Credentials
Mandatory. The user account credendials used to connect to the vCenter Server of ESXi Host.
.OUTPUTS Log File
The script log file stored in C:\Windows\Temp\Set-HostSNMP.log.
.EXAMPLE
.\Set-HostSNMP.ps1
#>
#---------------------------------------------------------[Initialisations]--------------------------------------------------------
#Set Error Action to Silently Continue
$ErrorActionPreference = 'SilentlyContinue'
#Dot Source required Function Libraries
. 'C:\Scripts\Logging_Functions.ps1'
#Add VMware PowerCLI Snap-Ins
Add-PSSnapin VMware.VimAutomation.Core
#----------------------------------------------------------[Declarations]----------------------------------------------------------
#Script Version
$sScriptVersion = '1.0'
#Log File Info
$sLogPath = 'C:\Windows\Temp'
$sLogName = 'Set-HostSNMP.log'
$sLogFile = Join-Path -Path $sLogPath -ChildPath $sLogName
#SNMP Settings
$global:sCommunity = '<COMMUNITY>'
$global:sTarget = '<TARGET>'
$global:sPort = '<PORT>'
#-----------------------------------------------------------[Functions]------------------------------------------------------------
Function Connect-VMwareServer{
Param([Parameter(Mandatory=$true)][string]$VMServer)
Begin{
Log-Write -LogPath $sLogFile -LineValue "Connecting to VMware environment [$VMServer]..."
}
Process{
Try{
$oCred = Get-Credential -Message 'Enter credentials to connect to vSphere Server or Host'
Connect-VIServer -Server $VMServer -Credential $oCred
}
Catch{
Log-Error -LogPath $sLogFile -ErrorDesc $_.Exception -ExitGracefully $True
Break
}
}
End{
If($?){
Log-Write -LogPath $sLogFile -LineValue 'Completed Successfully.'
Log-Write -LogPath $sLogFile -LineValue ' '
}
}
}
Function Start-ScriptExecution{
Param()
Begin{
Log-Write -LogPath $sLogFile -LineValue 'Enumerating ESXi Hosts and setting SNMP configuration...'
}
Process{
Try{
#Get list of all ESXi hosts in connected environment
$ESXHosts = Get-VMHost
ForEach($ESXHost in $ESXHosts){
Set-SNMPSettings -ESXHost $ESXHost
}
}
Catch{
Log-Error -LogPath $sLogFile -ErrorDesc $_.Exception -ExitGracefully $True
Break
}
}
End{
If($?){
Log-Write -LogPath $sLogFile -LineValue ' '
Log-Write -LogPath $sLogFile -LineValue 'Completed Successfully.'
Log-Write -LogPath $sLogFile -LineValue ' '
}
}
}
Function Set-SNMPSettings {
Param([Parameter(Mandatory=$true)][string]$ESXHost)
Begin{
Log-Write -LogPath $sLogFile -LineValue ' '
Log-Write -LogPath $sLogFile -LineValue " $ESXHost - Configuring SNMP Settings"
}
Process{
Try{
#Clear existing SNMP Configuration
Get-VMHostSnmp -Server $ESXHost | Set-VMHostSnmp -ReadonlyCommunity @()
#Add new SNMP Configuration
Get-VMHostSnmp -Server $ESXHost | Set-VMHostSnmp -Enabled:$true -AddTarget -TargetCommunity $global:sCommunity -TargetHost $global:sTarget -TargetPort $global:sPort -ReadOnlyCommunity $global:sCommunity
}
Catch{
Log-Error -LogPath $sLogFile -ErrorDesc " $ESXHost - An error has occurred" -ExitGracefully $False
}
}
End{
If($?){
Log-Write -LogPath $sLogFile -LineValue " $ESXHost - Completed Successfully"
}
}
}
#-----------------------------------------------------------[Execution]------------------------------------------------------------
Log-Start -LogPath $sLogPath -LogName $sLogName -ScriptVersion $sScriptVersion
$Server = Read-Host 'Specify the vCenter Server or ESXi Host to connect to (IP or FQDN)?'
Connect-VMwareServer -VMServer $Server
Start-ScriptExecution
Log-Finish -LogPath $sLogFile
Note: Similar to option 2 above, you will need to configure the following variables first:
<COMMUNITY> – This is the community string you require for your environment (same as in option 1 above).<TARGET> – This is the FQDN or IP address of the target you want to send the SNMP traps to.[su_note note_color=”#fafae8″]Note: THIS IS NOT A TARGET STRING as in option 1. In this instance you ONLY need the FQDN or IP address. The @port and the community_string will be added automatically by the Set-VMHostSnmp cmdlet. [/su_note]<PORT> – The port you require SNMP traps to be sent on.Finally, if you are lucky enough to be running Enterprise Plus licensing, then you will have the ability to use Host Profiles. This allows you to configure SNMP within the host profile and then just apply that profile to all of your ESXi hosts.
Follow these steps to add the SNMP configuration into an existing Host Profile:
target_address@port/community_stringAnd that concludes how to configure SNMP on a ESXi host.
]]>
I have only tested this solution on:

Repair your installation of Microsoft Visual J#® 2.0 Redistributable Package – Second Edition (x64)
The error went away after repair.
In trying to google the error some user have reported that uninstall the patch KB3147458 worked for them. I didn’t have the patch.
wusa.exe /uninstall /KB:3142024
Hope this helps.
]]>esxcli hardware pci list
esxcli storage san fc list
(output will be blank line if HBA driver is missing but HBA appears to be in PCI card determined from step 1)
esxcli storage core adapter rescan
New Installation
For new installs, you should perform the following steps:
scp VMware_bootbank_net-driver.1.1.0-1vmw.0.0.372183.vib [email protected]:/tmp
esxcli software vib install -v {VIBFILE}
In the example above, this would be:
esxcli software vib install -v /tmp/VMware_bootbank_net-driver.1.1.0-1vmw.0.0.372183.vib
Note: Depending on the certificate used to sign the VIB, you may need to change the host acceptance level. To do this, use the following command:
esxcli software acceptance set --level=<level>
Also, depending on the type of VIB being installed, you may have to put ESX into maintenance mode. This can be done through the VI Client, or by adding the ‘–maintenance-mode’ option to the above esxcli command.
Upgrade Installation
The upgrade process is similar to a new install, except the command that should be issued is the following:
esxcli software vib upgrade -v {VIBFILE}
Reboot host.
Now you should have the HBA should the datastores.
]]>WARNING: This trick will only work with an ESX(i) stand alone server. It will not work if the ESX(i) server is connected to a vCenter Server, as the vCenter Server knows better than to let you do this. (you can always remove and readd the ESX(i) server to vCenter.)
To reset your ESX 4.x, ESXi 4.x and ESXi 5.x 60 day evaluation license:
/etc/vmware/vmware.lic
/etc/vmware/license.cfg
If your ESX server is connected to a vCenter server, please remove the ESX server first. Once the steps above are completed, you can add it back to the vCenter server.
Command to remove the license and reboot the ESX host:
rm -f /etc/vmware/vmware.lic /etc/vmware/license.cfg reboot
After reboot, logging on the ESXi server, you should be greeted with this message.

For ESXi 5.1 and ESXi 5.5, you may need to continually remove the license files as the server reboots for this to work. The following should do this quite nicely:
rm -f /etc/vmware/vmware.lic /etc/vmware/license.cfg
reboot ; while true ; do
rm -f /etc/vmware/vmware.lic /etc/vmware/license.cfg
done
An alternative would be restarting the services, it should work just as well as rebooting the server:
# For ESXi 5.0 rm -f /etc/vmware/vmware.lic /etc/vmware/license.cfg services.sh restart
# For ESXi 5.1 rm -r /etc/vmware/license.cfg cp /etc/vmware/.#license.cfg /etc/vmware/license.cfg /etc/init.d/vpxa restart
For vCenter
1) Create a DSN to your local SQL Express instance that holds your vCenter DB.
2) Uninstall virtual center
3) Re-install virtual center and point to your DSN making sure not to overwrite.
With this method, I have been able to refresh my 4.1 and 5.0 hosts. Have not confirmed if this works for 5.1.
]]>
s guest operating system (OS) and improves management of the VM. Without the VMware Tools, guest OS performance will lacks some of the important functionality. Below steps shows how to install the VMware Tools on RHEL 7, CentOS 7 and Oracle Linux 7.
open-vm-tools is an open source implementation of VMware Tools from third parties and contains utilities that enhances virtualization management, administration and functions of the virtual machine in VMware environments. The ultimate goal is to enable the operating system vendors and/or communities and virtual appliance vendors to bundle VMware Tools into their product releases.
# yum install open-vm-tools
1. Install prerequisites :
# yum install perl gcc make kernel-headers kernel-devel -y
2. Attach the vmware tools sofware from vSphere client.
3. Mount the vmware tools package into /mnt :
# <strong>mount /dev/cdrom /mnt</strong> mount: /dev/sr0 is write-protected, mounting read-only
4. Copy vmware tool packagae into /tmp :
# cd /mnt
# ls manifest.txt VMwareTools-9.4.0-1280544.tar.gz vmware-tools-upgrader-64 run_upgrader.sh vmware-tools-upgrader-32 # <strong>cp -p VMwareTools-9.4.0-1280544.tar.gz /tmp </strong>
5. Go to /tmp directory and extract the vmware tools package :
# cd /tmp # <strong>tar xzvf VMwareTools-9.4.0-1280544.tar.gz </strong>
6. Go to extracted folder, vmware-tools-distrib :
# <strong>cd vmware-tools-distrib</strong> # ls bin doc etc FILES INSTALL installer lib vmware-install.pl
7. Run vmware-install.pl to start installation :
# <strong>./vmware-install.pl</strong>
Example:
# ./vmware-install.pl Creating a new VMware Tools installer database using the tar4 format. Installing VMware Tools. In which directory do you want to install the binary files? [/usr/bin] What is the directory that contains the init directories (rc0.d/ to rc6.d/)? [/etc/rc.d] What is the directory that contains the init scripts? [/etc/rc.d/init.d] In which directory do you want to install the daemon files? [/usr/sbin] In which directory do you want to install the library files? [/usr/lib/vmware-tools] The path "/usr/lib/vmware-tools" does not exist currently. This program is going to create it, including needed parent directories. Is this what you want? [yes] In which directory do you want to install the documentation files? [/usr/share/doc/vmware-tools] The path "/usr/share/doc/vmware-tools" does not exist currently. This program is going to create it, including needed parent directories. Is this what you want? [yes] The installation of VMware Tools 9.4.0 build-1280544 for Linux completed successfully. You can decide to remove this software from your system at any time by invoking the following command: "/usr/bin/vmware-uninstall-tools.pl". Before running VMware Tools for the first time, you need to configure it by invoking the following command: "/usr/bin/vmware-config-tools.pl". Do you want this program to invoke the command for you now? [yes] Initializing... Making sure services for VMware Tools are stopped. Stopping vmware-tools (via systemctl): [ OK ] The module vmci has already been installed on this system by another installer or package and will not be modified by this installer. The module vsock has already been installed on this system by another installer or package and will not be modified by this installer. The module vmxnet3 has already been installed on this system by another installer or package and will not be modified by this installer. The module pvscsi has already been installed on this system by another installer or package and will not be modified by this installer. The module vmmemctl has already been installed on this system by another installer or package and will not be modified by this installer. The VMware Host-Guest Filesystem allows for shared folders between the host OS and the guest OS in a Fusion or Workstation virtual environment. Do you wish to enable this feature? [no] The vmxnet driver is no longer supported on kernels 3.3 and greater. Please upgrade to a newer virtual NIC. (e.g., vmxnet3 or e1000e) The vmblock enables dragging or copying files between host and guest in a Fusion or Workstation virtual environment. Do you wish to enable this feature? [no] VMware automatic kernel modules enables automatic building and installation of VMware kernel modules at boot that are not already present. This feature can be enabled/disabled by re-running vmware-config-tools.pl. Would you like to enable VMware automatic kernel modules? [no] No X install found. Creating a new initrd boot image for the kernel. Starting vmware-tools (via systemctl): [ OK ] The configuration of VMware Tools 9.4.0 build-1280544 for Linux for this running kernel completed successfully. You must restart your X session before any mouse or graphics changes take effect. You can now run VMware Tools by invoking "/usr/bin/vmware-toolbox-cmd" from the command line. To enable advanced X features (e.g., guest resolution fit, drag and drop, and file and text copy/paste), you will need to do one (or more) of the following: 1. Manually start /usr/bin/vmware-user 2. Log out and log back into your desktop session; and, 3. Restart your X session. Enjoy, --the VMware team
8. Once successfully installed, make sure you umount (not unmount- missing the n) back the /mnt :
# umount /mnt]]>