Skip to content

Instantly share code, notes, and snippets.

@vmwarecode
vmwarecode / snippet.ps1
Created July 4, 2016 00:40
Update tools in bulk
Add-PSSnapin Vmware* -ErrorAction SilentlyContinue
Set-PowerCLIConfiguration -ProxyPolicy NoProxy -Confirm:$false
echo "Connect to ESX Server..."
Connect-VIServer -Server "10.1.2.3" -User "root" -Password 'pwd'
Get-VM | where { $_.PowerState -eq “PoweredOn” -and $_.Guest.IPAddress -ne $null -and $_.Guest.ToolsVersion -ne $null -and $_.Guest.ToolsVersion -ne ""} | update-tools -RunAsync:$false
Disconnect-VIServer -Server * -Force -Confirm:$false
@vmwarecode
vmwarecode / snippet.ps1
Created July 1, 2016 20:03
Configuring 3D settings of VM
#Author : Jyothsna Terli
#Product : vSphere/VM Video Card 3D settings.
function Set-VMVideoCard3D {
<# .Synopsis This changes the 3d and swRendering settings of the VM to enable and disable the 3D support.
#>
[CmdletBinding()]
Param (
@vmwarecode
vmwarecode / snippet.ps1
Created July 1, 2016 06:43
PowerCli Script to monitor number of snapshots for VMs in a vCenter Server
# The MIT License (MIT)
# Copyright (c) 2015 www.vThinkBeyondVM.com
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON
@vmwarecode
vmwarecode / snippet.sh
Created July 1, 2016 06:22
SetupVM and install
#! /bin/bash
#
# Global Variables with default values.
#
UTILS_PATH="$(dirname "$(readlink -f "$0")")"
DS="datastore1"
VMDK_SIZE="50GB"
REMOTE_PORT="5000"
@vmwarecode
vmwarecode / snippet.ps1
Created July 1, 2016 06:15
Deploy Stateless in VCVA
############################################################################
# VMware CopyRight
# Baoyin created in 2010-12-09
# This script used to Create the Depot for stateless ESXi.
#############################################################################
Add-PSSnapin Vmware* -ErrorAction SilentlyContinue
# Connect to the vCenter server
Connect-Viserver -Server VCServerIP -user root -password password -WarningAction SilentlyContinue|out-null
/*
* ****************************************************************************
* Copyright VMware, Inc. 2010-2016. All Rights Reserved.
* ****************************************************************************
*
* This software is made available for use under the terms of the BSD
* 3-Clause license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
/*
* ****************************************************************************
* Copyright VMware, Inc. 2010-2016. All Rights Reserved.
* ****************************************************************************
*
* This software is made available for use under the terms of the BSD
* 3-Clause license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@vmwarecode
vmwarecode / CreateTemporaryFile.java
Created June 27, 2016 20:53
CreateTemporaryFile
/*
* ****************************************************************************
* Copyright VMware, Inc. 2010-2016. All Rights Reserved.
* ****************************************************************************
*
* This software is made available for use under the terms of the BSD
* 3-Clause license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@vmwarecode
vmwarecode / DownloadGuestFile.java
Created June 27, 2016 20:53
DownloadGuestFile
/*
* ****************************************************************************
* Copyright VMware, Inc. 2010-2016. All Rights Reserved.
* ****************************************************************************
*
* This software is made available for use under the terms of the BSD
* 3-Clause license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@vmwarecode
vmwarecode / ConnectedVimServiceBase.java
Created June 27, 2016 20:53
ConnectedVimServiceBase
/*
* ****************************************************************************
* Copyright VMware, Inc. 2010-2016. All Rights Reserved.
* ****************************************************************************
*
* This software is made available for use under the terms of the BSD
* 3-Clause license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions