#LL @ME

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

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

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

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



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'


Passed CCA for XenDesktop 5

Passed CCA for XenDesktop 5 - Next will be CCA for XenServer

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

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


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

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!

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

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

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

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

Certified ITILv3

Officially ITILv3 certified... what's next??

Netscaler and Citrix Web Interface Setup

This guide assumes you have setup a basic Netscaler (e.g. DNS, NTP, IP) and Citrix Web Interface

Netscaler

Enable Access Gateway features
Access Gateway - Policies - Authentication - Servers (tab)
Add the domain controller

1

Access Gateway - Policies - Authentication - Policies (tab)
Add a new policy

2

Select the Server created earlier and add ns_true as expression

Access Gateway - Policies - Session - Profiles (tab)
Add a new profile

3

4

5

6

Change the Web Interface Address to your local web interface server path
Change the Single Sign-On Domain to your Active Directory domain

Access Gateway - Policies - Session - Policies (tab)
Add a new Policy

7

Add the ns_true expression
Change the Request Profile to the profile created earlier

Access Gateway - Virtual Servers
Add a new virtual server

8

Give an IP address
Select the SSL certificate (click here how to add SSL certificate to NetScaler)

9

10

11

Insert the policy created earlier

12

13

14

Add the URL to the STA

15

Citrix Web Interface

Create a new XenApp Web Sites
Authentication Point: At Access Gateway
Available Method: Explicit
Authentication Method:

16

Add the URL (https) that is publicly available for the user

Secure Access: Gateway Direct

17

Enter the publicly available URL to the address

18

19

Add the STA URL exactly the same with the STA servers you added to the Netscaler

Office 2010 Activation with KMS

To activate Office Suite and Standalone application 2010 using KMS, you can do the following:

Install Microsoft Office 2010 KMS Host License Pack to your KMS Host:
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=97b7b710-6831-4ce5-9ff5-fdc21fe8d965&displaylang=en

It will ask you to enter your Office 2010 KMS Volume License Key

Once entered you are ready to go - note, you need as least 5 clients try to activate Office 2010 before those clients are able to activate via KMS

From the client, you can either wait for Office 2010 to activate itself via KMS or you can force it using:

cscript ospp.vbs /act

note: ospp.vbs is located in your office14 installation folder

If you have already activated your Office using the MAK key, you can change that activation to KMS by entering KMS Client key:

cscript ospp.vbs /inpkey:

The KMS Client key can be found from:

http://technet.microsoft.com/en-us/library/ee624355.aspx

Once you have entered the KMS Client Key, you can either wait or force the activation using ospp.vbs /act

App-V Register and Refresh Server

App-V client needs to be configured to use a specific App-V Server to be able to see all the published application of the user logged in. To do this, you can either specify the server during the App-V client installation or using command line.

To use command line, I used the following method:

Enable user to manage server
Create a GPP for a computer that modifies the following registry entry:

HKLM\SOFTWARE\Microsoft\SoftGrid\4.5\Client\Permissions\ManageServers
set the value to 1

Add the server
Create a GPP for a user that executes the following command:

"%ProgramFiles%\Microsoft Application Virtualization Client\sftmime.com" ADD SERVER: /HOST: /TYPE:rstp

Refresh Application
Create a GPP for a user that executes the following command:

"%ProgramFiles%\Microsoft Application Virtualization Client\sftmime.com" REFRESH SERVER:

Import SSL Certificate to Citrix Netscaler

I use the following method to import SSL Certificate to Citrix Netscaler:
  • Find any Windows 2003 with IIS installed. Generate a CSR from this machine
  • Submit this CSR to your CA to get the private key of it
  • Import this private key to your IIS again
  • Export the certificate both public and private keys as a pfx file
  • Import this .pfx file to the Netscaler, it will generate a new file
  • Open this new file, it should have 2 sections, public and private sections
  • Create 2 new files, one for the public and one for the private section
  • Upload these 2 new files to the Netscaler (you can delete the .pfx and the generated file from Netscaler if you want to)
  • From Netscaler, add a new SSL certificate
  • Give a name to the new Certificate
  • Select the public certificate for the Certificate File Name
  • Select the private certificate for the Private File Name
  • You can use the SSL certificate now with CAG

Linux History Bash

To check the login history:
# last

To clear out the login history:
# > /var/log/wtmp

To check the last command run:
# history

To clear out the command history:
# history -c