Category Archives: snippet

Add and set screen mode using xrandr

This works in ubuntu if you want to set any other screen mode get the according screen line with cvt XRES YRES FREQUENCY
Also the device name may have to be modified but VGA1 is typical for an second monitor which is plugged in via VGA.


xrandr --newmode "1280x1024_60" 109.25 1280 1368 1496 1712 1024 1027 1034 1063 -hsync +vsync
xrandr --addmode VGA1 1280x1024_60
xrandr --output VGA1 --mode 1280x1024_60

ESXi CDP

To configure CDP for a Standard vSwitch:

Log in as root to the Service Console (via SSH, remote console, or physical console if connecting to ESX) or to management vmkernel port (if connecting to ESXi).

Verify the current CDP setting for the desired virtual switch (vSwitch1, in this example):

esxcfg-vswitch -b vSwitch1

You see an output similar to:

listen

The output of listen indicates CDP is configured to read CDP information from the physical switch if available.
This is the default setting for ESX/ESXi 3.5, 4.x, and 5.x.

Set the CDP status for a given virtual switch. Possible values here are down, listen, advertise or both.

  • Listen mode – The ESXi/ESX host detects and displays information about the associated Cisco switch port, but information about the vSwitch is not available to the Cisco switch administrator.
  • Advertise mode – The ESXi/ESX host makes information about the vSwitch available to the Cisco switch administrator, but does not detect and displays information about the Cisco switch.
  • Both mode – The ESXi/ESX host detects and displays information about the associated Cisco switch and makes information about the vSwitch available to the Cisco switch administrator.
esxcfg-vswitch -B both vSwitch1

Verify the new setting:

esxcfg-vswitch -b vSwitch1

You see an output similar to:

both

Enable CDP with PowerShell

$esxcli = Get-EsxCli -VMHost $myhost
$esxcli.network.vswitch.standard.set("both","1500","vSwitch0")

To configure CDP on a vNetwork Distributed Switches (vDS):

  1. Connect to vCenter Server using the vSphere Client.
  2. In the vCenter Server home page, click Networking.
  3. Right-click the vDS and click Edit Settings.
  4. Select Advanced under Properties.
  5. Using the checkbox and the dropdown, change the CDP settings.

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1003885

RDP – Configuring License server manually

There might be situation when you want to configure License server on the RD Session Host or on the RD Virtualization Host manually since you do not have any RD Connection Broker in your environment. You have already configured RD Session Host server or Virtualization Host Server as required and now you want to configure the License server which is already installed and configured with licenses. All you are left to do is configure the License Server and the Licensing mode on the corresponding RD session Host or Virtualization Host servers.

Note: The following commands must be ran from an Administrative PowerShell prompt.

To configure the license server on RDSH/RDVH:

$obj = gwmi -namespace "Root/CIMV2/TerminalServices" Win32_TerminalServiceSetting
$obj.SetSpecifiedLicenseServerList("License.contoso.com")

Note: “License” is the name of the License Server in the environment

To verify the license server configuration on RDSH/RDVH:

$obj = gwmi -namespace "Root/CIMV2/TerminalServices" Win32_TerminalServiceSetting
$obj.GetSpecifiedLicenseServerList().SpecifiedLSList

To change the licensing mode on RDSH/RDVH:

$obj = gwmi -namespace "Root/CIMV2/TerminalServices" Win32_TerminalServiceSetting
$obj.ChangeMode(value) - Value can be 2 - per Device, 4 - Per user

To validate the licensing mode on RDSH/RDVH:

$obj = gwmi -namespace "Root/CIMV2/TerminalServices" Win32_TerminalServiceSetting
$obj.LicensingType
$obj.LicensingName