05 October 2017

Error apply Hard Drive changes | Failed to add device 'Synthetic Disk Drive' | Hyper-V

So today I was adding a new disk to a clustered virtual machine running in a Hyper-V environment.
When I clicked 'apply' to save the changes I'd made, I received the following error message:

The device was being saved from one of the Virtual Machine Hosts, to a SAN where all the HDDs were located.

Luckily, this was a nice and easy fix.  When you're going into the drive settings, check on the top-left corner where it shows you the iSCSI Controller / IDE Controller.


Simply change this to one of the other settings, and click 'apply', to see whether it will let you save it.  In my case, it was set to IDE Controller 0, and I needed to change it to SCSI Controller.


Once you've changed this, you should be good to go!

07 September 2017

Veeam for Office 365 | Invalid Exchange Server version

Recently I noticed that clients of mine who were using Veeam for Office 365 started having issues with the product backing up their emails.

After looking into this, it looks as if Microsoft have updated their Exchange backend version without telling anyone, which has caused this issue.  Whilst there's no update available through Veeam at the moment, logging a support case with them provided me with a fix to get this up and running.

The error message in question here states "Invalid Exchange Server version".  This starts to fail for most mailboxes, and will eventually fail for all mailboxes.  Obviously this is a P1 issue, as you don't have backups up and running.

The fix is only available if you're running version 1.0.0.912, and is the following:


Download the hostfix file from https://storage.veeam.com/Fix_113114_fbcf2c440c.zip and follow the instruction to apply the hot fix. 

The workflow:
  1. Stop all the jobs
  2. Stop “Veeam Backup for Microsoft Office 365 Service”
  3. Rename and replace Veeam.Ews.dll with the DLL from the archive in C:\Program Files\Veeam\Backup365 (don't forget to back up the original DLL)
  4. Start “Veeam Backup for Microsoft Office 365 Service”
  5. Retry the job

After performing this fix, it has 100% resolved the issue for my clients.

30 May 2017

Hide User from GAL - Office 365 | AD Attribute

The following method will allow you to hide a user from the Global Address List if you're using Office 365 with Azure AD Connect.

From within AD, click on View, then Advanced Features


Find the user you'd like to amend and open up their AD object (note you will need to find the user account within AD, you can't search for it).

Find the following attribute and set it to True

msExchHideFromAddressLists


The next time Azure AD Connect syncs, it will update this attribute and the users will be hidden from the GAL.

Note: the GAL can take up to 24 hours to sync for each Outlook application.

16 May 2017

Update Hyper-V Integration Services

I was recently on a Hyper-V host where a few of the VMs were saying the integration services required an update.

To update this, open up the VM through Hyper V manager, then click Action > Insert Integration Services Setup Disk.


Run the setup from within the VM

A message will show up saying that it's detected a previous version of the services and asks whether you'd like to upgrade it


Once you've clicked OK, it will give you a progress bar for the installation


Once finished installing, you will need to restart the VM


The final step is to simply eject the Integration Services from the VM


This process will need to be carried out on each VM you're running in your environment, if you notice it requires an Integration Services update.  Just note that because of the reboot, it will cause down-time. 

07 May 2017

Office 365 Hybrid Deployment - Mail Loop

If you're ever in the middle of an Office 365 Hybrid deployment, you've configured everything correctly but you notice that when you're testing the mail flow from one premise to the other, it's causing a continuous mail flow (you will receive a NDR), the first thing I would suggest you look into is whether there's a gateway in the middle of your on-prem Exchange and your Office 365 environment.

Office 365 Hybrid is only supported if you have nothing between your on prem Exchange, and the O365 environment.  That means no IronPorts etc getting in the way.

I recently encountered an issue where there was a continuous mail flow symptom.  Office 365 was trying to deliver the email to on prem Exchange, it was caught up in the IronPort and then it tried to deliver it back to Office 365.  To get around this I opened Exchange up to the internet by NATting Port 25 on a different WAN IP which would bypass the IronPorts entirely.  I amended the Connectors in Office 365 so they'd connect through that address, rather than through the IronPorts.

Once this was done, the issue resolved itself immediately.

28 April 2017

Create new AD User with Remote Mailbox | Office 365 Hybrid

I recently had a client who had a Hybrid Office 365 who required a set of users to be created, and Office 365 mailboxes created at hte same time.  Whilst I could have had a script to create the users, then go through and add mailboxes to them, I decided that it would be better to smash it all in one hit.

Thanks to my colleague Gareth for writing this script

The following process is comprised of two steps.


  1. Run a script that references a CSV File
  2. A CSV file that has all the relevant information in it
In this case my CSV file had the following:


The BackupEmail was put there at the Client's request.  It was just an area to put the user's personal email address within the AD object.  

The script used is the following, which needs to be saved as CreateUsers.csv.  Note the bold areas which are the variables that have been included.


$Users = Import-Csv -Path "C:\Userlist.csv"
$OU = "OU=Sub-OU,OU=Parent-OU,DC=DOMAIN,DC=com,DC=au"     
foreach ($User in $Users)           
{           
    $Displayname = $User.Firstname + " " + $User.Lastname           
    $UserFirstname = $User.Firstname           
    $UserLastname = $User.Lastname           
    $SAM = $User.Username         
    $UPN = $User.Firstname + "." + $User.Lastname + "@domain"        
    $Password = "<insertpassword>" 
    $Mobile = $User.Mobile
     $remoterouting = "smtp:" + $UPN
     $Notes = $User.BackupEmail
    New-ADUser -Name "$Displayname" -DisplayName "$Displayname" -SamAccountName $SAM -UserPrincipalName $UPN -GivenName "$UserFirstname" -Surname "$UserLastname" -AccountPassword (ConvertTo-SecureString $Password -AsPlainText -Force) -Enabled $true -Path "$OU" -ChangePasswordAtLogon $false –PasswordNeverExpires $true -MobilePhone $Mobile -HomePhone $Notes
    Enable-RemoteMailbox $SAM -RemoteRoutingAddress $remoterouting
}

Save the script as well as the .csv file into the same location, then run the script through Exchange Management Shell.

This will create the user account and will also create the Office 365 Mailbox which can be viewed from either Exchange On Prem, or the O365 Tenant.  Remember that it takes a bit of time for Azure AD Connect to sync all the AD objects as well.  It might help to force an Azure AD Connect sync.

The last step you will need to do is to assign an Office 365 license to that particular user, or users.

03 April 2017

The Group Policy Client service failed the logon - Access is denied

I recently had a client who was receiving this error when he was trying to log into his domain account:


The fix for this is rather simple and straight-forward, however it's rather nasty if you don't know what to do.  The following steps can be followed to resolve this issue:


  • Login with another account, preferably a Domain Admin account
    • This should work as the issue is with the profile, not the computer
  • Create a local account on the machine and ensure it's also a local administrator
  • Remove the machine from the domain
  • Login as the local account you just created
  • Rename the profile name in C:\Users 
    • I would usually create a new folder called "Backup" and then move the profiles into there
  • Open Start Menu and search for Regedit
  • Open the following location
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList

  • Click on the different SIDs until you find the one that has Profile Path which is related to the user that's having problems

  • Right-click the SID and export it just to make sure you have a copy

  • Delete the SID

  • Join the computer back to the domain
    • I had deleted the computer object from AD and I even renamed the computer
  • Login as the user who was having problems
  • Should be working perfectly now.

29 March 2017

Update App Deployment Client Connectivity Restriction | SCCM

I recently had a client who's using SCCM, and was needing to install a particular application on many computers.  These machines happened to be in a workshop and they were testing the deployment by doing the manual install (through Software Centre).  They noticed that whilst they elected to install this particular app on about 30 machines, most of the workstations would say "Waiting to install", whilst only about 5 or so machines would actually be installing the app at one time.

Ultimately every machine received the application, however they wanted to know why it was limited to this small number, and what we could do to increase that.

To update this number to allow more machines simultaneously installing applications, we need to do the following:

Administration > Site Configuration > Sites > Configure Site Components > Software Distribution

The highlighted section is what I had updated.

The next part I updated was the following:

Administration > Site Configuration > Sites > Right-click site name and click Properties > "Sender" tab

I updated the circled settings to be 15 each.


21 March 2017

Increase Public Folder Quotas | Office 365

Recently a client of mine received a warning message saying a certain Public Folder was running low on space and they needed to delete some items.



This is the standard message you get from Exchange/Office 365 if your mailbox is running out of space etc, however with this being Office 365, I would have thought this limit would be much larger (or at least the client wouldn't have encountered this message for a period of time).

I logged into Office 365 and checked the Public Folder settings to make sure nothing was explicitly set, and that they were just getting the default quotas.


Whilst you can simply change the storage quotas section to not use the organisation quota defaults, this wasn't really practical as this client had about 15 different Public Folders.  It was much easier to just change the entire organisation's quota defaults and have it affect all the Public Folders.

In order to change this, you will need to do the following:

1. Sign into Office 365 through PowerShell
Note: this links to a previous blog post of mine which goes through how to sign into O365 using PS
2. Type the following command to find out what the current warning and prohibit quotas are set to:

Get-OrganizationConfig -DefaultPublicFolderIssueWarningQuota,DefaultPublicFolderProhibitPostQuota



As you can see here, the warning message is set to 1.7GB, and the prohibit message is set to 2GB. Neither of which is really acceptable. 

I changed this to warn at mailbox size 45GB, and prohibit at mailbox size 49GB.  This will mean that they will not have to worry about this filling up for a long period of time.

In order to do this, I typed two commands:


  1. Set-OrganizationConfig -DefaultPublicFolderProhibitPostQuota 49GB
  2. Set-OrganizationConfig -DefaultPublicFolderIssueWarningQuota 45GB
You can see in the below screenshot that after doing this, I then ran the Get-OrganizationConfig again to confirm the limits.


20 March 2017

Configure Squid Proxy with LDAP Auth | Active Directory

Recently a client of mine asked if we could implement a proxy server which forced each user to authenticate with their AD credentials.  They currently had a rather cut-down Squid server running in their environment and it was logging traffic, but there was no way to work out which users were browsing the most.  There was IP tracking, but when using a hot-desk situation, no user had a specific machine.

The following steps are what I've done to get this up and running where it forces each user to authenticate against AD, and denies all access if they don't authenticate correctly.

Assumptions: there is the assumption that you've already got a working copy of Linux up and running in your virtual environment.  In this case, I was using Ubunut 16.04.
The other assumption is that you have installed the LDAP role within Server Manager within your AD environment.

1. Download/Install Squid
sudo apt-get install squid
This will install Squid onto the Linux machine.  

2. Open ldap.conf which can be found at /etc/ldap/ldap.conf
3. Set BASE to your domain (in my case its test.internal as I've blogged this within a test environment).  I've updated the URI section too, however it's hashed out and not needed.
4. Edit squid.conf which can be found here: /etc/squid/squid.conf
5. Search for the follow section auth_param basic program, then enter the following details:
Note: most of this will already be there, you will just need to un-hash it.  The IP address used is the DC.  The blurred out section is the password I have used for the Administrator account which is mentioned within this section.
Also note that the credentialsttl will be how long a user can be logged in for before they're prompted again.  For testing purposes I set it to 15 minutes, you could set this to 2 hours.
6. Within the same document, search for acl safe_ports and then add the highlighted section below:
7. In the same document, search for http_access allow localhost, then add the highlighted section underneath it
8. Search for cache_dir ufs and then un-hash that section
9. Update the proxy settings within your environment to point to the Squid server on port 3128.  When you try to access a website, you should be greeted with the following message:



Install reporting tool for tracking user's browsing
In order to track the user's browsing, you will need to get Webmin, and also SARG.  These work together to allow you to make nice little reports which will show where users have been going and how much data they're using etc.

The following tasks will be completed within the Terminal
1. sudo nano /etc/apt/sources.list
2. Add the following two lines to the document you've just opened up
deb http://download.webmin.com/download/repository sarge contrib
deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib
3. Save the document and close out of it
4. sudo wget http://www.webmin.com/jcameron-key.asc
5. sudo apt-key add jcameron-key.asc
6. sudo apt-get update
7. sudo apt-get install webmin -y
8. sudo ufw allow 10000

This will then allow you to access the Webmin web portal on https://localhost:10000
Log in with your administrator (local admin) credentials

Click on un-used modules then find Squid Proxy
You will most likely see a message saying it wasn't able to find squid.  This will be because it's looking for /squid3/ rather than just /squid/.  You will need to edit the config and change squid3 to just squid everywhere you see it.



In order to use the Squid Report Generator, you will need to install SARG.  To do this, open Terminal and type the following:

sudo apt-get install sarg

Then you can click on Squid Report Generator within Webmin and be able to run reports on usage etc.

21 February 2017

Import Mail Contacts into Office 365 from CSV File | PowerShell

This blog post has been created as I have recently needed to upload hundreds of Mail Contacts into Office 365.

1. Create a CSV file which has the following columns:
ExternalEmailAddress,Name,FirstName,LastName

2. Populate the CSV file with the required contents.  Name will be their Display Name, so there cannot be any spaces etc.  Usually with this I will populate the FirstName & LastName and then have the following for Name:
=C2&D2
This will combine the first name and the last name and remove any spaces etc.  Then just drag this down for all the users and it will populate for everyone.

3. Save this file as ImportContacts.csv
4. Open PowerShell ISE and add the following contents
(change the bold section to reflect where you've saved your ImportContacts CSV file).

#Connect To Exchange Online 
$UserCredential = Get-Credential 
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection 
Import-PSSession $Session

#Function to pick the CSV File 
Function Get-FileName($initialDirectory) 

[System.Reflection.Assembly]::LoadWithPartialName(“System.windows.forms”) | 
Out-Null

$OpenFileDialog = New-Object System.Windows.Forms.OpenFileDialog 
$OpenFileDialog.initialDirectory = $initialDirectory 
$OpenFileDialog.filter = “All files (*.*)| *.*” 
$OpenFileDialog.ShowDialog() | Out-Null 
$OpenFileDialog.filename 
} #end function Get-FileName 
#Command To Launch Function and store it in the variable 
$PathToCSV = Get-FileName -initialDirectory "C:\Users\adam.arkwright\Desktop\ImportContacts.csv"

#Commands to import CSV file to contacts then export the contact list for comparison 
Import-Csv $PathToCSV | %{New-MailContact -Name $_.Name -DisplayName $_.Name -ExternalEmailAddress $_.ExternalEmailAddress -FirstName $_.FirstName -LastName $_.LastName} 
Get-MailContact | Select DisplayName,ExternalEmailAddress,FirstName,LastName | Out-GridView 
Get-MailContact | Select DisplayName,ExternalEmailAddress | Export-Csv "C:\Users\adam.arkwright\Desktop\ExportedContacts.csv"

5. Save this as ImportContacts.ps1 somewhere easily accessible. 
6. Open PowerShell as administrator and run ImportContacts.ps1

This will then ask you for your Office 365 Username and Password.  Make sure you use the administrator credentials.  If there's any issues, you may find a File Explorer windows pop up.  If this happens, simply navigate to where you've saved the .csv file and double click on it.  Then it will go through and start importing all the contents into your Office 365 tenant.

17 February 2017

Windows 10 | Connect to wireless automatically before logging in

A client of mine had a MS Surface running Windows 10.  They were almost 100% wireless and kept running into issues where they'd login to their profile and then it would connect to the wireless.  That's not usually a problem, however in this case it was a roaming profile and caused some issues with connectivity.

To get around this, I was able to save the credentials prior to logging in, which allowed the Surface to connect to the Wireless before they actually go through the login process, and ensure that it has access to a Domain Controller.

Click on the 'WiFi' option from Network Settings


Click Wireless Properties
Click Advanced Settings

Select User Credentials then click Save Credentials.  It will then ask you to type in a username and password which it will then use to authenticate against the wireless prior to logging in.

Note: this isn't a scalable solution, and merely designed to get one or two users up and running on wireless devices.  This will cause problems if the user's password expires as well.

For a scalable solution, you will need to use Group Policy and define a Service Account username and password.

24 January 2017

Set passwords to never expire | Office 365

Whilst the majority of Office 365 users would have DirSync configured so users will be using their Active Directory user accounts & passwords, some businesses will be using the cloud user accounts, which have their passwords expire.

It's very simple to configure all cloud O365 accounts to have their passwords never expire, which will especially stop the inconvenience of having to update admin accounts etc.

To do this, you will need to log into Office 365 through PowerShell.  You will also need to do the second part of the attached blog by connecting to the MSOL service.

Once you've done that, use the following command:

Get-MSOLUser | Set-MSOLUser -PasswordNeverExpires $true


22 January 2017

Office 365 Published Calendar | Publish Date Range | Extend Past 6 Months

I recently had a client who uses an Office 365 calendar to show up on a website of theirs.  This was to make a certain calendar publicly available to everyone.  They realised that the calendar on their WordPress website was only showing six months ahead of time, and didn't show anything further than that.

This can be changed to a maximum of 12 months ahead of time for viewing calendar items, which I think is sufficient for a publicly available calendar (published calendar).  In order to find out the current setting, you will need to do this through PowerShell with the following command:

Get-MailboxCalendarFolder -Identity <EmailAddress>:\calendar


The field you're looking for is PublishDateRangeTo.  In the screenshot above, it shows the already changed field.  By default, this is set to SixMonths.

This explains why your published calendar suddenly goes blank after exactly six months.  In order to change this, you will need to use the following command:

Set-MailboxCalendarFolder -Identity <EmailAddress>:\calendar -PublishDateRangeTo OneYear

Once you have done this, use the following command to double-check and make sure it's showing the correct setting now.

Get-MailboxCalendarFolder -Identity <EmailAddress>:\calendar

If you check your published calendar, you will see that it now shows 12 months worth of events.

18 January 2017

Configure SMTP Relay from On-Prem to Office 365

The following steps will guide you through creating a SMTP relay on a server which will allow you to use the Scan to Email functionality on printers/copiers etc, relaying through Office 365.

This is probably the easiest way to get devices emailing out once you've migrated to Office 365.

1. Find a server that you're going to use as the SMTP Relay, go to Server Manager and then Add Roles and Features

2. From Server Manager, click on Tools, then IIS 6.
If you haven't installed this yet, please do so

3. Expand the serer name, right click on SMTP Virtual Server #1 and click on Properties
4. Click Access tab, then Relay.  Then select either specific IPs or select "All except the list below".
5. Click the Delivery tab, then click Outbound Security, tick Basic Authentication, then enter a username and password of an Office 365 mailbox.  This is used for authentication with your Office 365 tenant.
6. Make sure TLS Encryption has been ticked
7. Click Delivery, then Advanced, then enter smtp.office365.com as the Smart Host address.

That is all you need to do to get the SMTP Relay up and running.  To test this is rather easy as well, and it's highly recommended that you test it before configuring devices to send through this relay service.  

Test Relay Service
1. Create a new Notepad document with the following contents

FROM: scantoemail@domain.com (same as the mailbox you're authenticating with)
TO: adam@mydomain.com (email you're sending the test to)
SUBJECT: Test email

Save this as Email.txt.  Copy this .txt file to C:\inetpub\mailroot\Pickup.  It should immediately disappear as it's picked up and sent through the relay.  

If this arrives in your mailbox, then it's all up and running.  Just make sure that when you're configuring printers etc, the send 'from' address needs to be the same address that you're authenticating with on the SMTP Relay server.  If the emails don't match up, it will error out and won't send.  You can setup the devices to send anonymously as well, and the authentication is done on the SMTP Relay server side. 

13 January 2017

Assign License via PowerShell | Office 365 | Script

Thanks to my colleague Gareth Harris for this script.

I have recently been running a few large-scale (1000+ mailboxes) and I've had to rely on scripts for assigning licenses and converting mailboxes to shared mailboxes etc.

This blog will cover the script to assign a specific Office 365 license to multiple users, based on their UPN.
  1. Create a folder on your machine called "Office 365"
  2. Create a CSV file with the header of "UserPrincipalName" and then fill the column up with the UPNs of the mailboxes/accounts that you wish to convert to Shared Mailboxes.  Save this as license.csv
  3. Open Notepad and add the following contents:
    $AccountSkuId = "<tenantname>:STANDARDWOFFPACK_IW_faculty"
    $UsageLocation = "AU"
    $Users = Import-Csv "C:\Folder\SubFolder\Office 365\License.csv"
    $Users | ForEach-Object {
    Set-MsolUser -UserPrincipalName $_.UserPrincipalName -UsageLocation $UsageLocation
    Set-MsolUserLicense -UserPrincipalName $_.UserPrincipalName -AddLicenses $AccountSkuId
    }
  4. Save this file as "AssignOfficeLicense.ps1"
To find out the AccountSkuId, you can use the following Cmdlet:

Get-MsolAccountSku

Simply copy the entire line of the license you want, and paste that here:

Log into Office 365 through PowerShell.  You can follow this blog post to be able to do that.  You will also need to use the final cmdlet in that post to connect to MSOL.

Navigate to the Office 365 folder and then run the .ps1 file with the following command:

.\AssignOfficeLicense.ps1

That will then go ahead and start assigning all the Office licenses to the mailboxes that you have mentioned in the CSV file. 

Thanks to my colleague Gareth Harris for this script.

Convert to Shared Mailbox | Office 365 | Script

Thanks to my colleague Gareth Harris for this script.

I have recently been running a few large-scale (1000+ mailboxes) and I've had to rely on scripts for assigning licenses and converting mailboxes to shared mailboxes etc.

This blog will cover the script to convert mailboxes to a Shared Mailbox, and then remove any associated Office 365 licenses with that user.


  1. Create a folder on your machine called "Office 365"
  2. Create a CSV file with the header of "UserPrincipalName" and then fill the column up with the UPNs of the mailboxes/accounts that you wish to convert to Shared Mailboxes.  Save this as license.csv
  3. Open Notepad and add the following contents:
    Import-csv "C:\Folder\SubFolder\Office 365\License.CSV" | foreach {
    $UPN = $_.userPrincipalName
    Set-Mailbox $UPN -Type “Shared”
    $MSOLSKU = (Get-MSOLUser -UserPrincipalName $UPN).Licenses[0].AccountSkuId
    }
  4. Save this file as "ConvertToShared.ps1"
Once you have done this, you will need to sign into Office 365 through PowerShell.  To do this, you can head over to this blog and follow the steps here.

Once you've done this, change your directory to the 'Office 365' folder that you had created.  Then run the 'ConvertToShared.ps1' file.  

.\ConvertToShared.ps1

This will then start the process of converting the mailboxes to 'Shared', and will also remove the licenses if there were any assigned.

Thanks to my colleague Gareth Harris for this script.

Sign into Office 365 | PowerShell

The following commands are used to sign into the PowerShell side of Office 365.  This is mainly for my use as I have to keep Googling where to find it.

$UserCredential = Get-Credential

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection

Import-PSSession $Session

If you need to use the MSOL commands, you will need to sign into that too, which you can use the following command:

Connect-MsolService -Credential $UserCredential

04 January 2017

Stop Server Manager from showing at logon | RDS

I recently configured a new RDS solution for a client where Server Manager was always popping up when logging in.  I didn't want this to happen for users, so I needed to make the required registry change for this to no longer happen:


Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ServerManager

There should already be a DWORD called DoNotOpenServerManagerAtLogon which is set to Decimal: 0.  Simply change this over to Decimal: 1 (as opposed to Hexadecimal: 1) to stop this from happening again.

You will still be able to open up Server Manager, however this won't appear automatically when logging in.

If you require IT Support in the Perth area, contact Winthrop Australia