Wednesday, October 9, 2013

Enable useSSLtrasport in VMware Mirage using Powershell.

 

mirage

As i always says, Powershell is a Sanjivini  for system administrators, You are use Powershell to do anything you like to do, and it is bless when it comes to create a fix, patch, automate some tasks.

Do you ever used VMware Mirage? If not ? try it, it is a cool applications. We are using VMware mirage in our environment.

Today , we did some changes on our VMware Mirage server and we changes the server’s connection mode to basic to SSL.

No we need to change some settings on the Mirage clients, we have approx 500 Mirage client installed.

Then i tried to find the solution first on how to change the Mirage Client’s connection mode to SSL and I have found the solution here :  https://communities.vmware.com/message/2297120

The Solution is “Edit the Wanova.Desktop.service.exe.config file and modify the "Key"  "useSslTransport" to true and then restart the Wanova Mirage service

And when i was reading about the solution , few things start coming in my mind:

  1. Stop “Wanova Mirage server”  service | okey, i can use Stop-Service cmdlet.
  2. modify Wanova.Desktop.service.exe.config  file | XML can be done easily.
  3. Start “Wanova Mirage server”  service | Use Start-Service cmdlet.

The last thing which come in my mind , i can script it, i can script it.

And here is complete and i added comments so that it would be easily understandable.

Download link : http://gallery.technet.microsoft.com/Enable-useSSLtrasport-in-cb341ad5

# Notes :-

#             --->   Please run this script as "Administrator"

#        Tested on : 64 Bit Client of Mirage.

#                  : 64 Bit Windows 7 Professional. 

 

# testing for file first

 

$testWanovaFile = Test-Path 'C:\Program Files\Wanova\Mirage Service\Wanova.Desktop.Service.exe.config'

 

#

if ( $testWanovaFile -eq $true )

 

       {

 

              # Mapping confifuration file as XML

              [xml] $wanovaXmlFile =  get-content 'C:\Program Files\Wanova\Mirage Service\Wanova.Desktop.Service.exe.config'

 

              # Finding the useSSLTransport Attribute

              $useSslKey = $wanovaXmlFile.configuration.appSettings.add | where { $_.Key -match "useSslTransport" }

 

              # Processing

 

              # If the UseSSL is not set to true

              if ( $useSslKey.value  -ne $true )

                     {

                          

                           # Stopping Wanova Mirage Desktop Service

                           Write-Warning "Stopping Wanova Desktop Service."

                      Stop-Service "Wanova Mirage Desktop Service" -Force

                     

                           # Setting SSLkey value to True

                           Write-Warning "Setting useSslTransport value to true"

                           $useSslKey.value = "true"

                     

                           # Saving the file with changes

                           Write-Warning "Saving the Configuration file."

                      $wanovaXmlFile.Save('C:\Program Files\Wanova\Mirage Service\Wanova.Desktop.Service.exe.config')

                     

                           # Staring the Service again

                           Write-Host "Starting Wanova Desktop Service." -ForegroundColor 'Green'

                           Start-Service "Wanova Mirage Desktop Service"

 

                     }

 

              else {

 

                           Write-Host "Value already set to true " -ForegroundColor 'Green'

 

                     }

      

       }

 

else

       {

      

       Write-Warning "Mirage Doesn't seem installed on this $env:COMPUTERNAME laptop"

      

       }     

 

###---- end of the script

Moral of the story: if you know PowerShell, you can fix every ( except broken heart ) thing.

I tested this on : Windows 7 64 Bit and with Mirage 64 Bit Client.

Download link : http://gallery.technet.microsoft.com/Enable-useSSLtrasport-in-cb341ad5

Thanks for your time.

Thanks

Aman Dhally

clip_image001 clip_image002 clip_image003 clip_image005  clip_image007

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.