19 June 2019

Veeam - Failed to create persistent connection to ADMIN$

I have been adding new Hyper-V hosts into Veeam recently, where the hosts for some reason have been left on a WORKGROUP.  This reuqires us to use a local administrator account, and quite often throws an error saying it "Failed to create persistent connection to ADMIN$".

This is luckily a very easy fix and can be sorted out within a couple of minutes by adding a registry DWOROD.

Navigate to the following:


Create a DWORD value called LocalAccountTokenFilterPolicy and assign it a value of 1.

Once you've done this, you can add the Hyper-V host to Veeam and it will work perfectly!

31 March 2019

SYSVOL and NETLOGON Share is missing in Newly Built Domain Controllers

I recently provisioned a new Domain Controller, running Server 2016.  

After joining to domain, adding the AD roles and then promoting to DC, I noticed the NETLOGON and SYSVOL folders were missing.  Not just the shares, but the actual folders themselves.

Luckily, I was able to fix this rather easily, by following these steps:

  1. Click Start, click Run, type regedit, and then click OK.
  2. Locate the following subkey in Registry Editor:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters
  3. In the details pane, right-click the SysvolReady flag, and then click Modify.
  4. In the Value data box, type 0, and then click OK.
  5. Again in the details pane, right-click the SysvolReady flag, and then click Modify.
  6. In the Value data box, type 1, and then click OK.
Once this is done, you simply have to stop and start the netlogon service.

  • Net Stop Netlogon
  • Net Start Netlogon

24 March 2019

Remove .local address before O365 Migration

I was recently performing an O365 migration for a client who had lots of domain.local aliases.
There was no policy enforcing these addresses, and their accounts weren't picking up email address policies either.

The best way to find out who's got the .local address and then remove it is by running the following commands/scripts:

get-mailbox | where {$_.emailaddresses -like “*domain.local*”}

This will show you who has the domain.local address.  Once you've worked this out, you can then run the following script, which will go through and make sure that address is completely deleted from each mailbox alias.

$users = get-mailbox | where {$_.emailaddresses -like “*domain.local*”}
foreach ($user in $users)
$addresses = (get-mailbox $user.alias).emailaddresses
$fixedaddresses = $addresses | where {$_.proxyaddressstring -notlike “*domain.local”}
set-mailbox $user.alias -emailaddresses $fixedaddresses

The bold sections is where you need to update the domain name to whatsoever your .local address is.

08 January 2019

Hybrid O365 User Creation

Here's a simple script created by a colleague of mine, for creating a new user account and assigning an O365 mailbox. 

$Users = Import-Csv -Path "C:\Users.csv"
$OU = read.host "What OU would you like the users created in?"       
$domain = read.host "What is your domain?"
$Password = read.host "What password would you like to set all accounts to?"     
foreach ($User in $Users)            
    $Displayname = $User.Firstname + " " + $User.Lastname            
    $UserFirstname = $User.Firstname            
    $UserLastname = $User.Lastname            
    $SAM = $User.Username          
    $UPN = $User.Firstname + "." + $User.Lastname + "@" + $domain
    $Mobile = $User.Mobile
    $Home = $User.PersonalEmail
    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 $Home
    $RemoteRouting = "smtp:" + $UPN
    Enabled-RemoteMailbox $SAM -RemoteRoutingAddress $RemoteRouting

The script will prompt the OU path where you want to create the users, the domain and the password you want to use.

It then creates the account, with the fields populated by the CSV file.
Those fields are Firstname, Lastname, Username, Mobile, PersonalEmail
Once the account is created, it will then create the mailbox on 365.

All that's left to do is assign the licenses.