@Hussein Guleed,Thanks for posting in Q&A.
From your description, I know you want to prevent users from changing hostnames via Company Portal
Based on my research, Rename – This action changes the device name that the user can see in the Company Portal. It does not change the local device name, only the listing in the Company Portal. Therefore, it will not rename the device in the Intune portal.
Moreover, there is no related feature in Intune can prevent users from changing hostnames via Company Portal, however, we can create a device name restriction policy to block users changing device name.
Here are the steps.
1.Go to Intune portal > Create an iOS configuration policy > Select iOS/iPadOS as platform, Setting catalog as Profile Type.
2.In Configuration settings page, search Restrictions > Select Allow Device Name Modification and set to False.
3.Assign it to device or user group
Then the device cannot change the device name.
Hope it will help.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.