@Houman Alavehzadeh, Thanks for posting in Q&A.
From your description, I know you want to enroll your Windows 11 to Intune but get error "We Couldn't auto discover a management endpoint matching the username entered. Please check your user name & try again, if you know the URL to your management endpoint. Please enter it" when we do the enrollment via Window 11 access work or school. If there's any misunderstanding, feel free to let us know.
Firstly, we suggest accessing Microsoft Endpoint Manager admin center->Devices->Enroll device->Automatic Enrollment, and check if the MDM URLs are there. If not, click "Restore default MDM URLs" to see if we can get the URLs.
Meanwhile, as a reminder, please ensure the user we enter to do the enrollment has Intune license assigned.
Also, you can check the method mentioned by @JatinMakhija to see if the issue can be fixed.
Hope above information can help you.
If the response is helpful, please click "Accept Answer" and upvote it.
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.