Friday, June 17, 2011

Powershell: Adding servers to published applications and publishing new application

Following Powershell script can be used to add servers to existing published application. Also this script will create and publish new applications.

CLS
Add-PSSnapin Citrix.*


###################################################
# Adding server to existing published applications
###################################################


Add-XAApplicationServer -BrowserName “Word 2003” -ServerNames "XENAPP2"
Add-XAApplicationServer -BrowserName “Excel 2003” -ServerNames "XENAPP2"
Add-XAApplicationServer -BrowserName “PowerPoint 2003” -ServerNames "XENAPP2"


##############################################
# Publishing new applications
##############################################


# Publishing MICROSOFT WORD 2003
New-XAApplication -ApplicationType "ServerInstalled" -DisplayName "Word 2003" -FolderPath "Applications/General Applications" -BrowserName "Microsoft Word 2003" -Enabled $true -CommandLineExecutable "c:\program files\microsoft office\OFFICE11\WINWORD.exe" -WorkingDirectory "c:\program files\microsoft office\OFFICE11" -AnonymousConnectionsAllowed $false -AddToClientStartMenu $false -InstanceLimit "-1" -WindowType "1024x768" -ColorDepth "Colors256" -ClientFolder "General Apps" -WaitOnPrinterCreation $false

#Add servers to the application
Add-XAApplicationServer -BrowserName "Microsoft Word 2003" -ServerNames "XENAPP1", "XENAPP2"

#Add users to the application
Add-XAApplicationAccount -BrowserName "Microsoft Word 2003" -Accounts "KOLKATA\Domain Users", "KOLKATA\Binayak"

# Publishing NOTEPAD
New-XAApplication -ApplicationType "ServerInstalled" -DisplayName "Notepad" -FolderPath "Applications/Server Testing" -BrowserName "Notepad" -Enabled $true -CommandLineExecutable "c:\windows\system32\notepad.exe" -WorkingDirectory "C:\Windows\system32" -AnonymousConnectionsAllowed $false -AddToClientStartMenu $false -InstanceLimit "-1" -WindowType "1024x768" -ColorDepth "Colors256" -ClientFolder "Testing" -WaitOnPrinterCreation $false

#Add server to the application
Add-XAApplicationServer -BrowserName "Notepad" -ServerNames "XENAPP2"


#Add users to the application

Add-XAApplicationAccount -BrowserName "Notepad" -Accounts "KOLKATA\Domain Users", "KOLKATA\Binayak"

ECHO "Done" 

Useful Links

General
  • Good link to check instantly DNS Settings, Reverse DNS, Firewall Test, Port Scanner, Spam Database Lookup, IP Location Finder and many more --> http://www.viewdns.info/
Microsoft

Citrix

How to determine version of installed Citrix server

In the Windows Registry, navigate to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Citrix
Check for the value
NewProductVersion

Wednesday, June 15, 2011

Some useful commands

Determining which application is using which port

To determine which application is using which port, use the tasklist command line tool along with the PID information from the netstat tool.
  1. On the server, click Start, click Run, type cmd, and then click OK.
  2. Type tasklist /svc and then press ENTER.
  3. Look for an entry for the PID number that is associated with the port (from the netstat output). The services or processes associated with that PID will appear on the right.
Checking installed product name and version of a particular application

Open Command Prompt and execute the following command:

wmic product where "Name like '%<product name>%'" get Name, Version

Here the below command will check the installed version of Citrix Online Plugin.
wmic product where "Name like '%citrix online%'" get Name, Version


List all installed Microsoft products

Open Command Prompt and execute the following command.
wmic product where "Vendor like '%Microsoft%'" get Name, Version
Saving WMI output to a file
To save the wmic output to a file, you can use the /output and(optionally) /format parameters, e.g.:

wmic /output:software.txt product get Name, Version
wmic /output:software.htm product get Name, Version /format:htable

Query user session on Terminal Server
query session /server:<server name>

Reset user session on Terminal Server
First query the user session to get the session ID using the command query session /server:<server name>

Once you get the ID, to reset that ID execute the following command.

reset session <ID> /server:<server name>


Monday, June 13, 2011

Citrix: Isolation Environment - Installing Office 2007

What Application Isolation Environment (AIE) can resolve ?

  • Application Conflicts
    • Run multiple version of the same application
    • Run multiple version of the same .DLL
  • Multi User Issues
    • Can solve configuration issues with hard coded path to .INI files
    • Can solve configuration issues with HKLM registry keys
  • Give users “Virtual” more rights to an application

Below is a screenshot cast demonstrating installation of Office 2007 into an Isolation Environment.

Note: If you have Office 2003 already installed, you must uninstall Office 2003 first and then install Office 2007 into isolation environment. After you complete the Office 2007 isolation installation, you can install Office 2003.

If you do not do this you will get error at the time of Office 2007 installation. Please click HERE for more details and step-by-step document about the resolution of the error.

Click HERE if you cannot uninstall MS Office from Add/Remove Programs.

There are two steps:
  1. Installation of application in AIE.
  2. Punlishing application

STEP-1: Steps to install Office 2007 into an Citrix Application Isolation Environment (AIE)

  • login to Citrix XenApp Advanced Configuration.
     
  • Create a new seperate isolation environment for the application. To do so, Right Click on Isolation Environments and then click on New isolation environment.

    Here I have created the isolation environment named "Office_2007".

  • Now you need to set the server in terminal server install mode. To do so, open Command Prompt and execute the following command:

    Change User /Install

     
  • Go to the following path:

    C:\Program Files\Citrix\System32 and execute the following command to put the environment into AIE install mode.

    AIESetup <Isolation Environment Name> <Installation Source>
    Here I have entered the following command.

    AIESetup Office_2007 E:\setup.exe
     
  • Once you run the above command you'll see application installer launched by AIE and below is the screenshot.
     
    Also Office 2007 installation wizard will pop up.

    Note: Do not press ENTER now.
     
     
  • Install Office 2007. After installation completed, press ENTER to complete the discovery process.

  • Once discovery gets completed, you will get the following screen.

  • To confirm the installation process go to Citrix XenApp Advanced Configuration. Right click on the Isolation Environment name you created and go to Properties. There you will see the applications you have installed using isolation environment.



  • Now you have the Office 2007 application successfully installed in XenApp AIE mode. The isolation installation location will be C:\Program Files\Citrix\AIE.
     
  • You can invoke the AIE application using the following command:

    Aierun.exe <Isolation Environment Name> "C:\Program Files\Citrix\AIE\Office_2007\Device\C\Program Files\Microsoft Office\Office12\WINWORD.exe"

    For example, here I have used the following command to invoke Microsoft Word application.

    Aierun.exe Office_2007 "C:\Program Files\Citrix\AIE\Office_2007\Device\C\Program Files\Microsoft Office\Office12\WINWORD.exe"

     
  • Now run the following command to set the terminal server in Execution Mode.

    Change User /EXECUTE
  • That's it. Now you have successfully installed and tested Office 2007 Application Isolation Environment.

    STEP-2: Publishing Application
     
  • Open Citrix Access Management Console.
     
  • Create a new Publish Application. The main points you should note is below (here I am publishing Excel 2007).







Sunday, June 12, 2011

Cannot Install Microsoft Office 2003/2007/2010

Point to note: Here I have tried with Office 2007 Enterprise Edition. However, this document is applicable for all versions of Microsoft Office.

Issue

After putting the product key, the Office 2007 installation window vanishes and you get the following event error in Application event log. Also you will get the following pop-up saying unable to proceed with Office 2007 installation.




























Causes
Sometimes you cannot uninstall the existing 2003, 2007 or 2010 Microsoft Office suite on your computer by using the Add or Remove Programs feature in Control Panel of Windows XP or the Programs and Features feature in Control Panel of Windows Vista, Windows 7 if one of the following conditions is true:
  • The installation process did not complete when you tried to install a new program. Therefore, you are left with a partially installed program. When you try to install the program again, you are unsuccessful.
     
  • A previously installed program cannot be removed because the installation files are corrupted.
     
  • If you had problems installing Office 2010 from a previous attempt.

Resolution
Download Microsoft Office uninstallation script Fix it from HERE and run that package. Try to install Office  after that.



See also: Cannot install Office 2007 to Citrix Isolation Environment

Citrix: Cannot Install Microsoft Office 2007 to an Application Isolation Environment

Scenario
I created an Isolation Environment called Office_2007. I have already Office 2003 installed on all of the Citrix servers. Now I am trying to install Office 2007 Enterprise into an Isolation Environment.

Problem
Unable to install MS Office 2007 to an Application Isolation Environment (AIE). I am getting the following error message.













































Causes

When you install Microsoft Office 2003 and/or Microsoft Office 2007, Microsoft Forms 2.0 .NET Programming Support in Office Tools is also installed by default.

If you install Microsoft Office 2003 locally, Global Assembly Cache (GAC) is registered under C:\Windows\Assembly.

When you install Microsoft Office 2007 to an AIE, the installer at first, refers to C:\Windows\Assembly. If the same version of Global Assembly Cache is already present, the installation terminates with the error message described above.

Resolution
To avoid this problem, install Microsoft Office 2007 to an AIE first, then install Microsoft Office 2003.

If you still unable to install Office 2007 in isolation environment, follow these instructions.


  1. Delete the isolation environment from Citrix Access Management Console.

     
  2. If you have multiple Citrix servers, then login into each server. Go to C:\Program Files\Citrix\AIE and delete the existing isolation folder name (here Office_2007).

     
  3. Now install Office 2007 using isolation environment.

    Click HERE to view step-by-step instructions about how to install Office 2007 in isolation environment.


Note: If you are facing problem in uninstalling Office, you can click HERE to get the resolution.