This example plugin registers itself in ConnectWise Automate and adds a Menu Item to the Tools menu that when clicked will open a designer friendly Window Form.
This example plugin registers itself in ConnectWise Automate, adds a TabPage to the Computer Screen, then attaches a designer friendly Control object to it.
While beginning to develop the AD Recycle Bin plugin for ConnectWise Automate (LabTech), it was a daunting task to find good examples of plugin code outside of the ConnectWise Developer documentation and the example plugin posted by Greg Buerk posted to Labtech Geek. The developer documentation while giving a good base of knowledge for the API’s and interfaces, it doesn’t give a good picture of what different types of plugins should look like. Greg’s example, while a great example of the different things you can do with a plugin, it’s only written in VB.NET and has so many different examples that it can be difficult to parse what’s needed for just one screen, such as a Computer Screen tab. My goal for this series of GitHub repositories is to provide easy to follow and documented plugin examples written in C#.
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:
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:
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:
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.
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.
Install Microsoft .NET Framework 4.5.x
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
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.