Intune renaming auto enrolled hybrid device

Copper Contributor
 I have few questions about their implementation if AA hybrid join, especially in regards to update cycle and computer rename -
 
For computer rename. 

I found a nice blog from Michael Niehaus Renaming Autopilot-deployed Hybrid Azure AD Join devices – Out of Office Hours (oofhours.com) about generating custom auto-generated computer names for hybrid join devices. 

For me I needed to input device names instead of dynamically generated names. I tried adding Read-host parameters in PowerShell but the package application did not work and did not prompt for the input.

Unfortunately, his blog does not give any option to post comments or reply anymore, therefore, I could not ask any question. I have a feeling the C# function code may need to be modified, if anyone has implemented this, please feel free to add comments and suggestions.

2 Replies
Hi,

As you can see, the win32 app is executed as "System" so... the read-host will be shown in the system context :). You could take a look at a blog of my how to make sure your app is communicating with the user context...

https://call4cloud.nl/2020/11/company-app-unchained/#part3

The same I am doing to deliver some toast notifications from the system the user context in this blog

https://call4cloud.nl/2021/07/quality-updates-international-preview-of-mystery-update/#part10

I hope you get the idea
I went through Mike Niehaus Out of office and other forums but most of them points to Azure function, Graph API and PowerShell 7 module to generate computer name based on serial number. was looking for input to manually rename trying using Readhost and write host on existing script to manually rename based on assset tag but it failed on package. Now I am trying powershell scritp that uses Graph API and MSAL which reaches upto intune and error out of intune fail to rename device. It stays device rename pending for about an hour and then changes to fail. The script talks to Graph API and performs all device query why it fails on rename is still a mystery