Hello,
Welcome to Microsoft Q&A!
According to KB5004442—Manage changes for Windows DCOM Server Security Feature Bypass (CVE-2021-26414), The Client Application is at least RPC_C_AUTHN_LEVEL_PKT_INTEGRITY Authentication-Level with enabling the hardening changes for CVE-2021-26414 And the hardening changes for CVE-2021-26414 make DCOM servers in Windows System enforce an Authentication-Level of RPC_C_AUTHN_LEVEL_PKT_INTEGRITY or higher for activation.
So, the code is OK. Also, You can check DCOM error events in the System log to verify.
Thank you.
If the answer is the right solution, 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.