Delete Suffix to application name

Added by Sebastien Baron , last edited by Sebastien Baron on Feb 20, 2008  (view change) show comment
Tags: 

 <package>
    <job id=" NoMoreSuffix">

        <comment>

        File:           NoMoreSuffix.wsf
        Description:    Delete Suffix to application name following installation of Hotfix PSE450R01W2K3035/PSE400R04W2K3012
        Requirements:   WSH 5.5 or higher.
       

        </comment>
        <runtime>
            <description>
              Delete Suffix to application name following installation of Hotfix PSE450R01W2K3035/PSE400R04W2K3012. Following the deployment of Hotfix PSE450R01W2K3035/PSE400R04W2K3012, a random suffix is added to the application name. this is source of issue with static ICA FILE or CUSTOM PORTAL as application display name doesn't correspond anymore to application name
            </description>
            <example>
                CScript //nologo NoMoreSuffix.wsf
            </example>
 
        </runtime>
        <reference object="MetaFrameCOM.MetaFrameFarm"/>
        <script language="VBScript">
       
            Dim theFarm
           
            '
            ' Create MetaFrameFarm object
            '

            Set theFarm = CreateObject("MetaFrameCOM.MetaFrameFarm")
            if Err.Number <> 0 Then
                WScript.Echo "Can't create MetaFrameFarm object"
                WScript.Echo "(" & Err.Number & ") " & Err.Description
                WScript.Echo ""
                WScript.Quit Err.Number
            End if

            '
            ' Initialize the farm object.
            '

            theFarm.Initialize(MetaFrameWinFarmObject)
            if Err.Number <> 0 Then
                WScript.Echo "Can't  Initialize MetaFrameFarm object"
                WScript.Echo "(" & Err.Number & ") " & Err.Description
                WScript.Echo ""
                WScript.Quit Err.Number
            End if

            '
            ' Are you Citrix Administrator?
            '

            if theFarm.WinFarmObject.IsCitrixAdministrator = 0 then
                WScript.Echo "You must be a Citrix admin to run this script"
                WScript.Echo ""
                WScript.Quit 0
            End If

            '
            ' Print out the farm name.
            '

            WScript.Echo "MetaFrame Farm Name: " & theFarm.FarmName
            WScript.Echo ""

             For Each anApp In theFarm.Applications

                 
                 WScript.Echo "Name             : " & anApp.AppName
                 WScript.Echo "BrowserName      : " & anApp.BrowserName
                   
   anApp.loaddata(true)
   '
             ' if application has been Suffixed then force application to correspond to display name
          '
   if anApp.BrowserName <> anApp.AppName then
    anApp.BrowserName2 = anApp.AppName
    anApp.savedata()
    wScript.Echo "Application " & anApp.AppName & " Is modified"
    end if
   'wScript.Echo "Application " & anApp.AppName & " Is modified"
  
            Next
 
     set theFarm=Nothing         
     set anApp=Nothing         
            WScript.Echo "Press ENTER to exit..."
      
        </script>
    </job>
</package>

  • Add to Bookmarks