Create an Azure Log Analytics workspace and add a Virtual Machine

Reading Time: 4 minutes

This blog post will go through the process of creating an Azure Log Analytics workspace and connecting a test azure virtual server to the Log Analytics workspace. We will then setup the work space to collect System event logs from the test Azure VM.

1) Login to the Azure Portal

2) Search and select Log Analytics workspaces

3) Click Create Log Analytics workspace

4) Configure:
– Give your new Log Analytics workspace a name
– Select your subscription
– Select a Resource Group
– Select Location
– Pricing Tier (Only one pricing Tier exists as of the year 2018). At the time of writing this blog post, the one available Tier was named Pay-as-you-go (Per GB 2018)

5) Click OK

6) Now that you have created your Log Analytics workspace, let’s join a VM to this new work space

Note that adding servers to the work space will automatically deploy a monitoring extension (agent) to the server

7) Click your new Log Analytics workspace

8) From the left pane under Workspace Data Sources, click Virtual Machines. As you can see from the screenshot, you can also connect other resources to your workspace


Note: Workspaces work across different regions, so you could add servers to a workspace no matter what region they are located in.

9) As you can see from the right pane, I have two virtual servers and the Log Analytics Connection is showing as not connected

10) Click a VM you wish to add to this work space (Ensure the VM is powered on)

11) As you can see from the below screen shot, the server is not connected to the work space, but we have the option to connect.

12) Click Connect

13) Wait for the virtual server to connect (A monitoring agent (Extension) is being deployed to the virtual server)

14) Now that the machine is connected to your workspace, the status is displayed as below. If you wish to disconnect, click disconnect.



Note: Now that the extension agent is deployed, you will find that the monitoring agent has been deployed to the VM. Locate the VM under virtual machines and click extensions from the left pane. The screenshot below shows the MicrosoftMonitoringAgent has been provisioned successfully.

15) If we go back to our workspace, we’ll find the server is now showing as a connection of this workspace along with a green tick.

16) Now, let’s enable logging for this workspace. Note that these logs will apply for all resources attached to this resource, so if you have different logging requirements for different resources, create different work spaces. You could also complete this step straight after the Logs Analytics Workspace has been deployed.

17) Click on your Log Analytics Workspace, and click Advanced Settings from the left pane.

18) The screen below will appear

Note: If you wish to connect physical servers to your Log Analytics Workspace, you can do so by downloading the required agent.

19) Click Data

20) A few different options appear which may be of interest to you. For this demo let’s click Windows Event Logs. Click the plus icon (blue box) to the right of the screen

21) For this demo, we will monitor the system logs, type system into the text box, select system and click the plus icon located within the blue box.

22) All logs are selected by default. You can select the logs as per your requirements.

23) Click Save and OK

Hope this helps 🙂

The maximum number of migration batches is already running

Reading Time: < 1 minute

When migrating mailboxes from Exchange Hybrid to Exchange Online (O365), you may receive the below error when attempting to migrate a new batch

The maximum number of migration batches is already running. Please remove a batch before you add another one.

The limit of the number of migration batches you can create is 100. The main purpose of why Microsoft set this limit is for performance reasons. Having more than 100 batches causes performance problems and could cause outages for other customers in the multi tenant system. You can check the limit by typing the below command within Exchange Online Powershell

Get-MigrationConfig |FL *max*

This error is common when migrating mailboxes from Exchange to O365 (Exchange Online) and users find that when they receive this error there are no other migration batches in progress.

This 100 batch number limit also includes batches which have already been completed. To get around this, remove a completed batch and start your new batch migration again. You’ll find that it works.

Please do comment below to let us know how you get on


‘Cannot start service MSExchangeServiceHost on computer’ when upgrading Exchange CU

Reading Time: < 1 minute

Issue:
When attempting to upgrade to a later version of Exchange Cumulative Update (CU) you receive the below error.

Cannot start service MSExchangeServiceHost on computer

You find that a number of Exchange services are automatically set to disabled as part of the update process but don’t reset to automatic, therefore, causing the above message to trigger. From the research I carried out, this issue has been experienced by users performing an update on different versions of Exchange and there doesn’t seem to be a permanent resolution at the time of writing this post. For some reason the process does not set the services back to automatic.

It’s impossible to start the Exchange Services manually as there are a few services that need to be set manually from disable to automatic and at the right time. Running the below script can help but you need to be constantly keeping an eye on when the services are disabled and the script needs to be triggered at the right time before the wizard passes to the next stage. A number of people failed at running the script below.

Get-Service *Exchange* | Set-Service -StartupType Automatic

I located a useful script posted on the Microsoft Blog within the comments section by a user named wandersick.

Note: ensure you have a backout plan in the event you need to roll back.

Here is the fix:

  1. Back up the original service startup types (Automatic/Manual/Disabled)
  2. Create a loop script to keep enabling the services during the CU upgrade. The script is:

while (1 -le 2) { sleep 1 ; Get-Service | where{$_.DisplayName -Like ‘Microsoft Exchange*’} | Set-Service –StartupType ‘Automatic’ }

3. After the upgrade, service startup types were manually restored from Automatic to their original settings

Thanks to wandersick for providing this solution

Upgrade Windows Server 2012 to Server 2019

Reading Time: 3 minutes

Microsoft recommend upgrading your server OS to the latest version, but this is not always possible. Your business may be running third party applications that are not compatible with later Windows Server Operating Systems.

Before upgrading, always check whether the applications running on your current Operating System are supported. It will save you a lot of time and disappointment.

So let’s continue on the basis that you have carried out your checks and the applications currently running on your server supports Server 2019.

Firstly, ensure you have a full backup of your server, so in the event the upgrade goes horribly wrong, you have a backup.

Note: If you have Microsoft Endpoint Protection installed, you will be prompted to remove this app. This app is not compatible with server 2019

Now, that you are all set, you may be thinking, can I upgrade directly from server 2012 or server 2012 R2 to Server 2016? The answer is yes, you can and it’s a supported method. See support matrix from Microsoft below. So whether you decide to upgrade from Server 2012 to 2019 or from 2016 to 2019 a one hop in-place upgrade is supported.

Available in-place upgrade paths

Ok, so we now have a full system backup, and we know that third party apps are supported with server 2016/2019.

Before we get started with the upgrade, Microsoft recommend that you collect some information from your device, for diagnostic and troubleshooting purposes. Because this information is intended for troubleshooting purposes only, store the information at a location where it’s easy accessible and not on the server being upgraded.

To collect your info

  1. Open a command prompt, go to c:\Windows\system32, and then type systeminfo.exe.
  2. Copy, paste, and store the resulting system information somewhere off of your device.
  3. Type ipconfig /all into the command prompt, and then copy and paste the resulting configuration information into the same location as above.
  4. Open the Registry Editor, go to the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion hive, and then copy and paste the Windows Server BuildLabEx (version) and EditionID (edition) into the same location as above.

Upgrade Server 2012 to 2019

1) Patch your server with the latest windows updates if not already up to date
2) Locate the Windows Server 2019 Setup media, and then select setup.exe
3) Select the Windows Server version you wish to upgrade to

Screen to choose which Windows Server 2012 R2 edition to install

4) Accept the licensing terms

Screen to accept your license agreement

5) If you’re running Microsoft Endpoint Protection on your server, setup will prompt for this app to be removed as it isn’t compatible with Windows Server 2019

6) Select Keep personal files and apps, and then select Next

Screen to choose your installation type


7) After Setup analyses your server, setup will prompt you to proceed with your upgrade by clicking install

Screen showing you're ready to start the upgrade

8) Wait for the upgrade to complete

Screen showing your upgrade progress

9) To ensure the upgrade completed successfully

– Open the Registry Editor, go to the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion hive, and view the ProductName. You should see your edition of Windows Server 2019, for example Windows Server 2019 Standard. Make sure all of your applications are running and that your client connections to the applications are successful.

If you think something might have gone wrong during your upgrade, copy and zip the %SystemRoot%\Panther (usually C:\Windows\Panther) directory and contact Microsoft support.