Thursday, April 12, 2012

NetScaler MAC Based Forwarding

In the situation where you have deployed your NetScaler with 2 NICs, one connected to the DMZ network and the other one is connected to your Internal network, depending on your configuration, you might need to enable the MAC Based Forwarding on NetScaler

You probably assign the NSIP on your Internal Network, MIP on your Intenal Network, SNIP and VIPs on your DMZ Network (for example for publishing CAG/SSL VPN). You then trying to access your NetScaler services from your Internal Network. This means your traffic from the Internal network goes to your default gateway (e.g. the firewall) which then forwarded to the VIP on DMZ Network. NetScaler then accept the traffic, however, the returning traffic will not going back to through the firewall (e.g. NetScaler default gateway), it will be going to the other NetScaler's NIC that connects to Internal network. This will create asymmetric routing, and most router/firewall will drop the packets.

To avoid this, usually enabling the MAC Based Forwarding (MBF) will fix this.

The following is the definition of MBF:

With MAC-based forwarding (MBF) enabled, when a request reaches the NetScaler appliance, the appliance remembers the source MAC address of the frame and uses it as the destination MAC address for the resulting replies. MAC-based forwarding can be used to avoid multiple-route/ARP lookups and to avoid asymmetrical packet flows. MAC-based forwarding may be required when the NetScaler is connected to multiple stateful devices, such as VPNs or firewalls, because it ensures that the return traffic is sent to the same device that the initial traffic came from.


To enable it, from the NetScaler Console:

enable ns mode mbf

Wednesday, April 11, 2012

XenServer 6.0 Kill Dead VM

Sometime when you try to restart or shutdown the VM, its status get stuck with the yellow status on XenCenter.

To forcely kill that VM:
  •  Login to the XenServer console where the VM is hosted
  • Get the VM Dom ID 
xe vm-list name-label={VM Name} params=dom-id
  • Get the list of live domains and see if the Domain ID of your VM is listed there
list_domains
  • If your Domain ID VM is there, run the killing script
/opt/xensource/debug/destroy_domain -domid <dom id>
  • Do another list_domain to check the Dom ID is gone
  • Reset the power state of that VM
xe vm-reset-powerstate vm={VM Name} force=true
  • If that still does not work do
xe-toolstack-restart

SharePoint 2010 - Get Logged In User Details

To get the user details using JavaScript from SharePoint 2010, use the following code:

the SP.JS file should be available from the standard installation folder of SharePoint 2010

Sunday, April 08, 2012

FreeNAS 8 and Time Machine

I have just finished setting up the FreeNAS 8 on Hyper-V to backup my MAC using Time Machine.

Tricky bits settings up FreeNAS 8 on Hyper-V:

  • Remove the default NIC when creating VM
  • Add a new NIC, must be legacy NIC
  • FreeNAS 8 does not recognize SCSI disks, only IDE
  • After installed, change the IP to static
  • do: ifconfig to find out the adapter name
  • do: ifconfig down
  • do: ifconfig up

Once the FreeNAS is up and running, go to its web console:
  • Create a group called: backup-group
  • Create a user called: backup-user, with primary group ID: backup-group, enter the password
  • Go to Services, enable AFP
  • Go to AFP Settings, make sure Local Access is ticked
  • Go to Storage, and Create ZFS Data Set, called backup-apple
  • Once it is created, edit its permissions, make sure owner-user is changed to backup-user and owner-group is changed to backup-group. Tick the option to have the Group the write access
  • Go to Share, add Apple Share. Name it backup, path: /mnt/data/backup-apple. Make sure the Disk Discovery is ticked, Disk Discovery Mode is set to Time Machine
From my MAC, start Finder:
  • Click Go, and select Connect to Server
  • Enter Server Address: afp://freenas-ip
  • It will ask you for the username: backup-user, password: password
  • Start Console, type:defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1
  • Start Time Machine and Select Disk, select the backup

Thanks for reading :)

Tuesday, April 03, 2012

Exchange 2010 SP2 Upgrade

Just done my Exchange 2010 upgrade to SP2, which includes the following steps:
  • Login to Active Directory Server which holds schema master, as schema master and enterprise admin user, and run: setup.com /ps and setup.com /p
  • Upgrade all the Hub/CAS
  • Upgrade all the UM
  • Upgrade all Mailbox Servers:
  1. Enable maintenance mode on the DAG of the server to be upgraded:

.\StartDagServerMaintenance.ps1 -server server1

  1. Upgrade to SP2
  2. Disable maintenance mode

.\StopDagServerMaintenance.ps1 -server server1

Thursday, March 08, 2012

Sharepoint 2007 Access User Profile

To access user profile details from a page within SharePoint, you need the following:

Download the latest jQuery SPServices JavaScript from here
Upload the JavaScript to your SharePoint site
Add a Content Editor Web Part to the page
Edit the Content Editor Web Part, include the following:








The userName and Email have got the value of the logged on user

Sunday, January 22, 2012

Passed Citrix XenServer 5.6 Exam

Yay! today I passed 1Y0-024 Citrix XenServer 5.6 Exam - 2 more to go to get the CCEE for Virtualization

Tuesday, January 10, 2012

ESXi 4.1 NIC Driver Update

To update the ESXi 4.1 host with the latest NIC driver

  • Download the ISO file from VMware
  • Extract the ISO file and find the offline-bundle ZIP file
  • SCP this ZIP file to the ESXi host (e.g. /tmp/driver.zip)
  • Run the following command

esxupdate –bundle=/tmp/driver.zip update

reboot

Friday, December 30, 2011

AppSense Upgrade from 8.0 to 8.1

Recently I have to upgrade AppSense from version 8.0 to 8.1

Our 8.1 environment was messy, the Outlook profile (e.g. registry entries) was stored in both Managed application registry and Desktop Settings registry. This caused a lot of problems, like secondary mailbox not being retained, unable to use "Send To Email" from any other application, etc.

To fix this, I had to do the following:

After the upgrade was done to 8.1, before the users start using Outlook, I exported all the users from EM personalisation DB, using the SQL query bellow:


SELECT [Name]

FROM [AppSensePersonalizationDB].[dbo].[User]

WHERE [DomainName] = 'DOMAIN'


Please note, my DB name is AppSensePersonalizationDB, yours probably has different name

Then save the result as a txt file, e.g. users.txt, which has entry like the following:


user1

user2

user3


You have to install AppSense EM Manager Tools to be able to use the EMPRegUtil. Once installed, create a batch file:

@echo off

SET EMPRegUtilConnectionString=Data Source=EMDB;Initial Catalog=AppSensePersonalizationDB;Integrated Security=SSPI


for /f "tokens=*" %%i IN (users.txt) DO call:doit %%i

:doit

if "%~1" == "" goto end

@echo %~1

@echo exporting MS Office 2010 Outlook profiles...

EMPRegUtil EXPORT DOMAIN\%~1 "Production" "MS Office 2010" "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook" C:\temp\%~1.reg

@echo deleting MS Office 2010 Outlook profiles...

EMPRegUtil DELETE DOMAIN\%~1 "Production" "MS Office 2010" "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem"

@echo deleting Session Data Outlook profiles...

EMPRegUtil DELETE DOMAIN\%~1 "Production" "Session Data" "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem"

@echo importing to Session Data Outlook profiles...

EMPRegUtil IMPORT DOMAIN\%~1 "Production" "Session Data" C:\temp\%~1.reg

:end

Please note:

my database server name is: EMDB

Run the batch script, it will export the Outlook profile from Managed application, delete the registry from managed application, delete the registry from session data and import the registry back to session data



Tuesday, November 15, 2011

Exchange 2007 Restore

Had to restore someone else mailbox today - using NetBackup 7.

Steps involved:
  • Create the Recovery Storage Group
  • Restore the Storage Group that has the database of the mailbox to be restored to the Recovery Storage Group
  • Mount the database in that Recovery Storage Group
  • Create an empty mailbox (AD User + Mailbox)
  • Restore the mailbox to the new mailbox

Restore-Mailbox -RSGMailbox 'Doe, John' -RSGDatabase 'Recovery Storage Group\Mailbox Database 01' -id 'new mailbox' -TargetFolder 'myFolder'


Saturday, October 08, 2011

Thursday, September 22, 2011

Active Directory DNS Waiting for Initial Replication

When you boot the 1st domain controller within the environment which has more than 1 DC, by default the DC is waiting for initial inbound replication from the other DC. But because this is the first DC you boot, this is going to take a while

To avoid this, add the following key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NTDS\Parameters
Value name: Repl Perform Initial Synchronizations
Value type: REG_DWORD
Value data: 0

Add Reboot!
Do not use this method in the producation environment

Monday, August 22, 2011

MOSS 2007 Shared Service Provider - ACCESS DENIED

I have just done a clean MOSS 2007 installation and tried to open the Shared Service Provider Link and got a BIG ACCESS DENIED ERROR!!

Here is the fix

http://support.microsoft.com/kb/896861


Monday, July 04, 2011

PowerShell AD Group Membership Listing

To get the member of a particular group in Active Directory:

Get-ADGroup -filter 'name -eq "Group Name" | Get-ADGroupMember -Recursive | fl name

Replace the "Group Name" with the group name from which you want to get the member of

Tuesday, June 28, 2011

PS3 Media Server + Samsung TV

Just got my Samsung TV, connected to the network WiFi.
Got the PS3 Media Server installed on my OSX, with a little bit tweak:

PS3 Media Server\renderers\Samsung.conf:

MimeTypesChanges=audio/wav=audio/L16|video/x-matroska=video/avi
StreamExtensions=mkv,mp3,mp4,avi

The movies are streamed awesomely to the TV!

Tuesday, May 24, 2011

Citrix XenApp Management Console Bug

Citrix XenApp 5 or 4.5FP2 has got a bug - when you launch CMC and run the discovery, it does not find the XenApp farm, only the Web Interface module.

To fix it, run the following:

cd %CommonProgramFiles%\Citrix\*Present*
%windir%\microsoft.net\framework\v2.0.50727\regasm /codebase pse.core.dll
cd %CommonProgramFiles%\Citrix\*Framew*
CmiLaunch.exe

Run the discovery again and it should find it now

Thursday, April 14, 2011

Upgrade IOS on 877W ISR Wireless Module

It is a bit tricky to update the AP module inside the Cisco ISR 877 Series.

1st, assign an IP address to the VLAN of the router

interface vlan 1
ip address x.x.x.x y.y.y.y
no shut

2nd, assign the wlan-ap 0 interface with IP unnumbered

interface wlan-ap 0
ip unnumbered vlan 1

3nd, access the wlan-ap 0 module console

service-module wlan-ap 0 session

4th, assign an IP address to BVI0/BVI1 interface

interface BVI0
ip address z.z.z.z y.y.y.y
no shut

5th, get the IOS image from the tftp

archive download-sw tftp://x.x.x.x/ios.version.tar

6th, write mem and reload

wr mem
reload

Tuesday, March 15, 2011

HP Blade E-Fuse

To reset one of the blades on the HP enclosure, telnet to the OA, then issue the following command:

reset server [bay no]

[bay no] is the bay number of the blade that you want to reset

Monday, February 21, 2011

Remote Assistant with Mandatory Profile

By default, you cannot launch Remote Assistant to help a user who is running on Mandatory Profile. For example, running XenDesktop + AppSense + Mandatory Profile is a good mix of technologies - however when a user having problem, you won't be able to start Remote Assistant session to their XenDesktop session.

To fix this, use the following VBScript to modify the registry:

Option Explicit
Const HKLM = &H80000002

Dim objReg, strRegKey, strRegValue, strRegData, objAdInfo, objUser, username, objWMIService, objAccount, strComputer, wmipath, oShell, usersid, domain
strComputer = "."

Set oShell = CreateObject( "WScript.Shell" )

username = oShell.ExpandEnvironmentStrings("%UserName%")
domain = oShell.ExpandEnvironmentStrings("%UserDomain%")

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
wmipath = "Win32_UserAccount.Name='" & username & "',Domain='" & domain & "'"

Set objAccount = objWMIService.Get(wmipath)
usersid = objAccount.SID

Set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & ".\root\default:StdRegProv")
strRegKey = "Software\Microsoft\Windows NT\CurrentVersion\ProfileList\" & usersid & "\"

strRegValue = "State"
strRegData = "0"

objReg.SetStringValue HKLM, strRegKey, strRegValue, strRegData

WScript.Quit 0 'Return success

They way we do it, we attach this VBScript everytime the msra.exe process starts - this makes sure the "State" is set to 0 before the msra.exe process started

Monday, January 24, 2011