CategoryTech

Unable to Open vSphere Client

If you haven’t kept your vSphere Client up to date then it’s possible that updates from Microsoft to the .NET framework have caused an issue where you are unable to open vSphere Client, receiving the following message:

The type initializer for VirtualInfrastructure.Utils.HttpWebRequestProxy’ threw an exception.

If this is the case you have two solutions to get it going again. The first is the easiest solution, updating to the latest vSphere Client. If you would like to stay at the current vSphere Client version then there is a solution to problem.

Fixing Your vSphere Client

In Explorer, navigate to:

%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\

In this folder there should be a file called system.dll, copy this file to the following folder:

C:\Program Files (x86)\VMware\Infrastructure\Virtual Infrastructure Client\Launcher\lib

Notes: On 32-bit machines it will be “Program Files” instead of “Program Files (x86)”. You may have to create the lib folder if it doesn’t exist.

In the “Launcher” folder there is a file called “VpxClient.exe.config”. Open this file with a text editor. Near the end of the file before the </configuration> tag add the following lines and save the file:

<runtime>
<developmentMode developerInstallation=”true”/>
</runtime>

Now open the System properties from the control panel, then Advanced System Settings. Inside of the Advanced System Settings you will now need to launch the Environment Variables editor.

Add the following environment variable:

Variable: DEVPATH

Value: C:\Program Files (x86)\VMware\Infrastructure\Virtual Infrastructure Client\Launcher\Lib

Note: On 32-bit machines it will be “Program Files” instead of “Program Files (x86)”.

Now you should be able to launch your vSphere Client without an issue.

Connect to Exchange Online with Powershell

In my previous post I talked about using Powershell to connect to Office 365 to manage the service. Using that method you will be able to manage user accounts and other settings that only apply to the Office 365 service itself. If you would like to connect to Exchange Online with Powershell to manage users’ mailboxes then Microsoft also provides cmdlets that allow you to perform these tasks.

Prerequisites

Install Microsoft .NET Framework 4.5.x

Install Windows Management Framework 3.0 or 4.0

Launch Powershell

You will want to right click Powershell and use Run as Administrator.

Office 365 Credentials

Now that you have the Powershell window ready to go, issue the following command in the Powershell window. Once you do, it will launch a window requesting your username and password for Office 365.

$cred = Get-Credential

Getting Office 365 Credential

Connecting to Exchange Online

With the credential stored you can now use it to connect to the Exchange Online service.

$exchSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri “https://outlook.office365.com/powershell-liveid/” -Credential $credential -Authentication “Basic” -AllowRedirection

If authentication was successful, you are now connected to your Exchange Online organization and can manage your service from there.

Disconnecting from Exchange Online

Once you’ve finished the Exchange Online management tasks in Powershell you will then need to free up your session by removing it.

Remove-PSSession $exchSession

Connecting to Exchange Online with Powershell

Connect to Office 365 with Powershell

Using the Office 365 web interface to manage a tenant isn’t always the most ideal choice, based on what you’re trying to accomplish, especially if you would like to automatic or perform bulk tasks. Luckily Microsoft provides cmdlets that let you connect to Office 365 with Powershell.

Prerequisites

Install Microsoft .NET Framework 4.5.x

Install Windows Management Framework 3.0 or 4.0

Install Microsoft Online Services Sign-In Assistant for IT Professionals RTW

Install Azure AD Module for Windows PowerShell (x86 or x64)

Launch Powershell

You will want to right click Powershell and use Run as Administrator.

Load Required Modules

Once you have Powershell launched, the first thing you will want to do is load modules that you will need to connect to Office 365 using Powershell. Issue the following command in the Powershell window to load the MsOnline module.

Import-Module MsOnline

Office 365 Credentials

Now that you have the MsOnline module loaded you’re going to need to get and store your Office 365 credential in a variable. Issue the following command in the Powershell window. Once you do, it will launch a window requesting your username and password for Office 365.

$cred = Get-Credential

Getting Office 365 Credential

Connecting to Office 365

With the credential stored you can now use it to connect to the service.

Connect-MsolService -Credential $cred

If authentication was successful you are now connected to your Office 365 organization and can manage your service from there.

Connect to Office 365 with Powershell

© 2015 Dustin Riley

Theme by Anders NorenUp ↑