anyweb Posted August 6, 2020 Report post Posted August 6, 2020 Introduction I received a brand new HP Laptop (HP EliteBook 830 G6) to verify our current Autopilot setup, and I went through OOBE. All seemed well and I was curious about the version of Windows shipped so I ran WinVer. The following screen appeared. Notice how the registered owner and registered organization fields are automatically populated with HP's default settings, this was a Windows Autopilot enrolled HP delivered with HP's business clean image (no bloatware). The following registry key reveals where those values are set. HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion if the following REG_SZ keys are missing: RegisteredOrganization RegisteredOwner You'd see the following instead. So now that I knew why I was seeing those values I decided to fix it. Step 1 - Add a PowerShell script to Endpoint Manager In Microsoft Endpoint Manager select Devices and then select Scripts as shown here (alternatively, choose Devices, Windows, PowerShell Scripts...) Click on Add and select Windows 10 as the operating system. Fill in the Name of the script and a description, note that the Name does not have to match the actual name of the script. Note: you must be a logged in member of windows-noob.com to download this script. Next, point it to the PowerShell script which you can download here and select to Run this script using the logged on credentials. Next select the Groups you want to assign it to, I selected my Windows 10 Autopilot DEVICES group Step 2. Test an Autopilot device Start OOBE (out of box experience) on an Autopilot enrolled device. move through the screens and you'll have to enter your credentials at the welcome to your Tenant name screen after signing in successfully the Enrollment Status Page will appear (if configured to do so) Step 3. Verify changes If everything went according to plan, after a while Windows Autopilot will be completed and you'll be logged on to the desktop, you can now verify the changes by typing WinVer. Troubleshooting If things didn't go as planned take a look at the IntuneManagementExtension.log with CMTrace. It's found in the C:\ProgramData\Microsoft\IntuneManagementExtention\Logs folder and confirm that the script ran successfully and that it ran in User context (user was a local admin in this case). If you need to run it as SYSTEM then change the variable for RegisteredOwner in the script to something else. job done ! Downloads Here's the PowerShell script used above ConfigureRegistered_User_Org.ps1 Quote Share this post Link to post Share on other sites More sharing options...
shakti Posted April 7, 2021 Report post Posted April 7, 2021 If user is not local admin then we can use below command to set the value of $UserName and run as system context $UserName = (Get-ItemProperty (Get-ChildItem -Path "HKLM:\SOFTWARE\Microsoft\Enrollments" -Recurse -ErrorAction SilentlyContinue | % {if((get-itemproperty -Path $_.PsPath) -match "UPN") { $_.PsPath} }) -Name UPN | Select -ExpandProperty UPN).split('@')[0] Quote Share this post Link to post Share on other sites More sharing options...