>NULL

Thursday, 25 July 2019

Create a CSV of AD users and their managers

Run the following in PowerShell changing the path at the end to suit your needs, the output can then be sorted by the Manager column in Excel.

get-aduser -Filter * -Properties Manager | Select-Object Name,sAMAccountName,Manager | export-csv C:\Scripts\UsersWithManagers.csv -notypeinformation

Monday, 22 July 2019

Using forfiles to remove older backups (last resort) 14 days and older.

Add the following as a second step in the SQL job, possible catches are you need to set the first step behavior as run second step on success. Modify Advanced Page for success action. Second step Type: Operating System (CmdExec).

F:
CD F:\SQLBackups
forfiles /m *.bak /c "cmd /c Del @file" /d -14


Friday, 19 July 2019

HP Chromebook 11-1101 Resurrection, Orange Light, will not power on

So my trusty old HP Chromebook 11-1101 (the slim cheap blue and white Chromebook pictured below) turned it's self off due to low battery last night. Fair enough, I put it on charge, this morning the charging light was still orange, I disconnected the charger and flipped the power off at the wall then back on reconnected the charger but noticed the orange light was still on, without the charger connected.

Oh, and it wouldn't power on either!

So here's the fix. Hold the Power  and Refresh  keys down simultaneously for 5 seconds. Your Chromebook will turn off the orange charging light and boot up all being well.

I thought my favourite laptop of all time had gone to laptop heaven, but it seems CPR exists for Chromebooks.



Image result for hp chromebook 11-1101

Tuesday, 2 April 2019

.Net framework will not install

.Net framework refuses to install even if you point it to a source.


  1. Go to the following registry key:
  2. HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU
  3. In the right-pane, if you see UseWUServer set its value to 0
  4. Exit regedit
  5. Restart Windows

Wednesday, 16 January 2019

Converting a Synced with Active Directory user to a InCloud user

Microsoft recently closed the loophole of deleting a AD user and restoring it in AzureAD/Office365 as a way of migrating user accounts to AzureAD.

Here is the currently supported method I was given by Microsoft Support and have successfully used.

Import-Module Azure 
$LiveCred = Get-Credential
Connect-MsolService -Credential $LiveCred

Set-MsolDirSyncEnabled –EnableDirSync $false

(I answered ‘y’ when prompted)

Wait until you stop getting the ADSynced user warning in the O365 portal when you try to edit a username, this takes around 10 minutes.

Set-MsolUser -UserPrincipalName test.user@example.com -ImmutableID ""

Wait 10 minutes.

Set-MsolDirSyncEnabled –EnableDirSync $true
(I answered ‘y’ when prompted)
This last step will take 6-8 hours-ish.

Once this is all finished and the sync re-starts you will see the user you cleared the ImmutableID for show as InCloud.


Adding a Azure AD user to local Administrators group

To add an additional administrator to an Azure joined computer.

1, Ensure the new AzureAD user has logged in then out.
2, Login as an admin (AzureAD or local account).
3, Run the following in CMD.
    net localgroup administrators AzureAD\UserAlias /add
4, The next time the user logs in they will have local admin rights.

Use the user alias, not the whole email address, remember that the user must have logged in previously to create a profile on the computer before you do anything.


Monday, 17 December 2018

Show the old style credential manager in Windows 10 (including credential backup and restore)

Show the old style credential manager in Windows 10 (including credential backup and restore)

rundll32.exe keymgr.dll,KRShowKeyMgr


Wednesday, 2 May 2018

Windows 8.1 VPN error 720

There is a tool to correct Error 720 on Windows 8 & 8.1 VPN (Built-in client). I used this ages ago but lost track of it until a random 8.1 machine with this old issue today.

https://www.vpnhosting.cz/index.php/clanky/wan-miniport-repair-tool-solve-vpn-and-dial-up-error-code-720-and-similar-ppperrors.html


Tuesday, 13 February 2018

Server 2016 Downloaded Maps Service stopped in Server Manager

Stupid service, disable it.


Get-Service -Name MapsBroker | Set-Service -StartupType Disabled -Confirm:$false

Wednesday, 1 November 2017

The remote computer disconnected the session because of an error in the licensing protocol. Please try connecting to the remote computer again or contact your server administrator.

This appears to be caused by a corrupted Registry key on the user's PC, I was able to recreate the issue on a Windows 7 machine by deleting the below key. It should be fixable by importing that key from another PC. A Registry backup should obviously be taken before making any changes.

Location:    HKEY_LOCAL_MACHINE\Software\Microsoft\MSLicensing\HardwareID
Key:    ClientHWID
Type:    REG_BINARY


Tuesday, 5 September 2017

Setting default Start [home] pages in IE

So you want to push your users towards that shiny new web portal. Using a GPO seems the obvious route.

Here's how.

Use a GPO to update a Registry key in the following location.
HKCU\Software\Microsoft\Internet Explorer\Main


Here are the key details for the first tab/single tab.

Action : Update
Hive : HKEY_CURRENT_USER
Key Path: Software\Microsoft\Internet Explorer\Main
Value name (default unticked) : Start Page
Value type : REG_SZ
Value data : http://www.google.co.uk

If you want to add a second tab...

Action : Update
Hive : HKEY_CURRENT_USER
Key Path: Software\Microsoft\Internet Explorer\Main
Value name (default unticked) : Secondary Start Pages
Value type : REG_MULTI_SZ
Value data : http://www.theregister.co.uk

You can set the policy to apply once and not reapply if needed as usual with a Group Policy Object.



Wednesday, 30 August 2017

RemoteApp on Windows 7 client prompts for credentials second time and says Login Failed

Sometimes people have older PC's that you have to support. I know right, FFS...

A perfectly functional RDS RemoteApp deployment (in Win 8 - 10) will give you a Login Failed password prompt when launching an app from the web portal.

Your primary suspect should be HTTP Redirection in IIS. Turn it off! 

To bump people from the default HTTP site to RDWeb use the following html file customised with your domain.

<html>
  <head>
    <title>RDWeb redirect</title>
    <META http-equiv="refresh" content="0;URL=https://remote.EXAMPLE.co.uk/RDWeb/">
  </head>
  <body bgcolor="#ffffff">
    <center>Forwarding you to https://remote.EXAMPLE.co.uk/RDWeb/ <a href="https://remote.EXAMPLE.co.uk/RDWeb/"> https://remote.EXAMPLE.co.uk/RDWeb/</a>
    </center>
  </body>
</html>