Wednesday, February 20, 2013

NetScaler - N2N Files

NetScaler to NetScaler File Transfers

So you want to transfer over either an SSL cert or config file to another NetScaler. There are many ways to do this, but in this scenario, I will be using the command "scp" form the NetScaler

Scenario

  • NetScaler A
    • Version 10.0
    • Hostname: nsvpx_a
    • IP: 10.0.0.1
    • User: nsroot
    • Password: toor
  • NetScaler B
    • Version 10.0
    • Hostname: nsvpx_b
    • IP: 10.0.0.2
    • User: nsroot
    • Password: toor
SCP Usage
  • scp [[user@]from-host:]source-file [[user@]to-host:][destination-file] 
SCP Options
  • r = recursively copy entire directories
  • p = preserves modification times, access times, and modes from the original file
  • C = compression enable
  • q = Do not display the progress bar
  • v = Displays debugging messages
SCP Examples

Copying NS.CONF
I want to copy the ns.conf file from nsvpx_a to nsvpx_b
  • scp -rpC /nsconfig/ns.conf nsroot@10.0.0.2:/nsconfig/ns.conf
Copying all *.CONF Files
I want to copy all the ".conf files" from nsvpx_a to nsvpx_b
  • scp -rcP /nsconfig/*.conf nsroot@10.0.0.2:/nsconfig/
Copy all SSL Certs and Keys (Copy all Files in a Directory)
I want to copy everything in the ssl folder from nsvpx_a to nsvpx_b
  • scp -rcP /nsconfig/ssl/* nsroot@10.0.0.2:/nsconfig/ssl

Friday, February 15, 2013

PowerShell - Show VMWARE VM UUID

How to show the VMWARE UUID of a VM using PowerShell

I am working on a project where one of the functions is to get the UUID of a VM from the guest vm via PowerShell. You can get the "Windows" UUID with:

  • (Get-WmiObject Win32_ComputerSystemProduct).UUID
The problem is that a lot of the values are reversed. Below are examples of a Windows UUID and a VMWARE UUID.
  • Windows UUID
    • F8420542-10A9-9961-5225-C6F8D91A468D
  • VMWARE UUID
    • 420542f8-a910-6199-5225-c6f8d91a468d
So i needed to figure out a way to move the variables around. To do this, I used ".substring" with delimiters to extract out each value, and then piece it back together. I am not a PowerShell expert in any means, so if you think there is a better way to accomplish any of what I am doing, there probably is. 
  • NOTE: There is another way of doing this with "vSphere PowerCLI" and Get-VM commands. I did not want to go that route, because I did not want to download or install anything to accomplish my task. I wanted to do this from a PowerShell CLI.

The Script:


##
## Begin Script vmware_show_uuid.ps1
##


######################################################
# "Find VMWARE UUID"
# By: Keith Smith - smith.itpro@gmail.com
# Date: 2/15/2013
######################################################

# Set Variables
$uuid = (Get-WmiObject Win32_ComputerSystemProduct).UUID

# Section 1
$uuid11 = $uuid.Substring(0,2)
$uuid12 = $uuid.Substring(2,2)
$uuid13 = $uuid.Substring(4,2)
$uuid14 = $uuid.Substring(6,2)

# Section 2
$uuid21 = $uuid.Substring(9,2)
$uuid22 = $uuid.Substring(11,2)

# Section 3 
$uuid31 = $uuid.Substring(14,2)
$uuid32 = $uuid.Substring(16,2)

# Section 4
$uuid41 = $uuid.Substring(19,4)

# Section 5
$uuid51 = $uuid.Substring(24,12)

# Piece the strings together
[string]$uuida = "$uuid14$uuid13$uuid12$uuid11"
[string]$uuidb = "$uuid22$uuid21"
[string]$uuidc = "$uuid32$uuid31"
[string]$uuidd = "$uuid41"
[string]$uuide = "$uuid51"
[string]$uuidfixed = "$uuida-$uuidb-$uuidc-$uuidd-$uuide"

# Clear everything on the screen and pop up the VMWARE UUID
clear
$msgbox = new-object -comobject wscript.shell
$x = $msgbox.popup("$uuidfixed",0,"VMWARE UUID",1)

##
## End Script
##




Tuesday, February 12, 2013

Citrix PVS - Error: vDisk is not available

So I got to work this morning with the intention of reverse imaging a couple vDisks. Usually a simple process, but today I am having nothing but issues. Luckily it is the same issue on each of the vDisks. So here is a quick synopsis of how I am reverse imaging:
  • Add a Secondary Disk to my VM
  • Use Xenconvert to copy my "c:\" volume to the new vmdk I attached
  • Set the new drive to "active" and reboot to the bios
  • Set the VM to boot off the HD
  • Boot the VM
  • Remove VMWARE Tools
  • Remove Target Device Software
  • Reboot
  • Add VMWARE Tools (Now upgraded)
  • Add Target Device Software (Now upgraded)
  • Run through PVS Wizard and "Optimize"
  • Reboot to Bios and set boot order to PXE first
  • Let the PVS Imaging Wizard complete after logging in
So now for the issue.. At this point, instead of the wizard taking over and completing the process it gives me a very vague error message. To me it doesn't really tell me anything.
  • Error: vDisk is not available. Please check your network PXE boot Configuration and restart imaging wizard
Going through the event log I see Event ID 7026
  • Event ID 7026 - The following boot-start or system-start driver(s) failed to load: Bnistack
The reason I am seeing this is because there is a hidden NIC somewhere in my system, and the PVS Imaging Wizard does not know what to do with it. How do we fix this? By removing the NIC and re-installing the Target Device software.

Show Hidden Devices
  • Uninstall the Provisioning Server Target Device software from the virtual machine and restart
  • Open up the Environment Variables
  • Click the New button below the System Variables panel
  • In the New System Variable dialog box, type in the variable name:
    • devmgr_show_nonpresent_devices
    • Set the variable value to 1
  • Click OK to return to the System Properties dialog box and then click OK again
  • Access Device Manager > View > Show Hidden Devices
  • Expand the network adapters in the device tree and look for the inactive icons, which indicate unused device drivers
  • Re-install the Provisioning Server Target Device software and restart
  • You should now be able to connect to the virtual disk
The ghost NICs are as displayed in the following screen shot:

  • Remove the environmental variable after completing the procedure.

XenApp - Install and Publish SQL Server Management Studio


Citrix XenApp SQL Server Management Studio Installation

Versions I am working with:
  • OS: Server 2008 R2 Standard 64-bit
  • Citrix: XenApp 6.5
  • SQL: SQL Server 2008 R2 Management Studio
Below was the error I was receiving when trying to install SSMS:
  • “Another version of Microsoft Visual Studio 2008 has been detected on this system that must be updated to SP1. Please update all Visual Studio 2008 installations to SP1 level, by visiting Microsoft update.”



First off, "DO NOT REMOVE CITRIX". That is not a required step. Even if you saw that on some Citrix forum. You just need to install Visual Studio and Visual Studio SP1. To accomplish this:
  • Install Visual Studio
    • E:\1033_ENU_LP\x64\Setup\vs_shell.msi
  • Install Visual Studio SP1
    • E:\1033_ENU_LP\x64\Setup\VS90sp1-KB945140.msp

SQL Server Management Studio will now install without any issues. If you want to publish it via Citrix just point you app towards:
  • "C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe"

Monday, February 11, 2013

WINSXS Too Big?

How to shrink your Winsxs directory

If I had a nickel for every time I had a drive space issue due to the "Winsxs" directory.... I'd probably only have 50 cents. Right now I have a 14GB Winsxs Directory ( c:\windows\winsxs ) and need to do something with it. To fix the issue on your server, open up a command prompt as adminiistrator, and run the following command:

  • dism /online /cleanup-image /spsuperseded
That will take some time depending on the size of it. I just went from 14GB to 7.7GB, and it took about 2-3 minutes to run. I am thinking it may be a good idea to just create a start up script with the dism command in it to automate this on reboots. On my PVS'd servers, I am just going to  setup a personality string to remove the winsxs directory on boot if the server is in standard mode.

Where’s my enabled Users?

Where’s my enabled Users? I’m going through and fine tuning our Proodpoint Spam solution and noticed one of the filters needs to be updated....