Posts

The Set-AzureADUserThumbnailPhoto PowerShell cmdlet ImageByteArray"

When you try and set an Azure Active Directory user thumbnail using the ImageByteArray parameter the command fails and you see the following error System.Management.Automation.CmdletInvocationException:   ---> System.ArgumentException:      at Microsoft.Open.Azure.AD.CommonLibrary.Utilities.ImageUtils.GetImage(Stream fileStream, String filePath, Byte[] imageByteArray) in X:\bt\1205398\repo\src\dev\PowerShell.V2\CommonLibrary\Utilities\ImageUtils.cs:line 114 This appears to be a bug in the internal code of the PowerShell cmdlets. To work around this in C# you need to convert your byte[] array to a memory stream, and use the FileStream parameter. This should work as expected. /// <summary> /// Sets the thumbnail photo for the specified acccount. /// </summary> /// <param name=" identifier "> The user principal name or object identifier of the user for which the thumbnail photo value should be set. </param> /// <par...

Getting the WinForms HelpProvider namespace for a control programatically using C#

We recently had an issue whereby we wanted to have a Windows Form control in a control library which could be presented with a HelpNamespace and HelpKeyword that could be customised based on the end product that the UI was integrated with. The control itself automatically inherits the help of the parent, but when the control opens a child form that Windows Form doesn't know of the help information. However, manually assigning the HelpNamespace to the UI control which it then passes to the form seemed tedious given that the form on which the control resides already knows the namespace, but how to get that namespace programatically. The HelpProvider is a component, not a control so you need to use the following code. If the control doesn't have a HelpProvider assigned directly, the controls' parent is queried. /// <summary> /// Returns the help namespace assigned to the specified control, or its parent form. /// </summary> /// <param name=" control ...

Going to Barbados for in 2020/2021 and the coronavirus COVID-19 crisis

Image
If you're in Britain and looking to escape winter, COVID, and BREXIT the Barbados government is looking get you in and get you spending.  Here's my experience and honest feedback of the island. Barbados got onto the UK FCO exception list of countries it's safe to go to, if the country isn't on the list your insurance probably won't be valid. You really need insurance. I found StaySure  was pretty sensible, we paid for cover for a couple of days before, and several weeks after we're due to return to be safe. BE WARNED:  Some travel insurance won't cover you at all if you don't have a return flight booked when you leave.   Barbados is a small island and all but stamped out Coronavirus  and is using a membrane plan to not let new infections in Barbados put countries into categories based on their risk. The UK is HIGH risk . High risk countries need to get a PCR test before coming here and a fit to fly certificate. You have to pay private as the NHS won...

How to open multiple copies of Regedit.exe at the same time to compare registry keys.

Image
If you want to open multiple copies of Regedit.exe at the same time - for example if you want to compare two regions of the registry you can do this with the command regedit.exe /m regedit.exe -m

Escaping paths with backslashes, single quotes and double quotes in WMI WQL in C#

So we've started digging back into our very old WMI support functions. Given that most of our code now uses PowerShell remoting these have been left in the dark for a while but we thought it was time to refresh them given our Windows agent always falls back on WMI when PowerShell remoting isn't available.... And we still have customers supporting Windows Server 2003. The problem we found was how do you escape path names properly given we were getting some varying results. Let's say for example we have a file here "D:\WmiTest\Dave's.exe" and we want to get the information using the CIM_DataFile class. Correct query You can use single quotes for the query parameter but you must then escape both the backslashes and the single quote. SELECT * FROM CIM_DataFile WHERE Name='D:\\WmiTest\\Dave\'s.exe' Correct query You can use double quotes for the query parameter but you must then escape the backslashes but not  the single quote. SELECT * FROM CIM_DataFi...

When enabling data tethering (personal hotspot) on iPhone using LIME you get the error "To enable Personal Hotspot on this account, contact LIME"

Image
When enabling data tethering (personal hotspot) on FLOW in the Caribbean you get the error "To enable Personal Hotspot on this account, contact LIME" LIME was FLOW's previous company name. To solve the issue go to Settings > Mobile Data (Cellular Data in US) > Mobile Data Options (Cellular Data Options in US) From here scroll to the Personal Hotspot section and change the APP from internet to ppinternet. This solution was provided by FLOW here on Twitter https://twitter.com/queensim/status/777624735219716096

Barclays Online Banking International Payment Error Code 33355

So I was just trying to make an international payment using Barclays online banking but it showed an error We are experiencing technical difficulties and cannot complete this transfer. Please ring us on XXXX and quote us Code 33355 Luckily @jonboyes on Twitter had already had this problem and complained in 2017. Looks like Barclays haven't fixed the problem. https://twitter.com/jonboyes/status/915197444211736577 The solution is to NOT paste the long numbers into the web page, but to manually type them in. Once I cleared the fields and retyped them the problem went away.