Hello @Subramanyamk-9132
The error message Insufficient privileges to complete the operation.
should be consistent for a given identity because if the identity (User/Application) has required permissions it should always work and if required permissions are not assigned, it should always fail. Could you please confirm if you are using multiple identities for this purpose or its a single account that you are using? Based on the authenticating entity, there can be different permissions required:
- If you are using User context to make above call, you would need to assign Delegated permissions - Application.ReadWrite.All, Directory.AccessAsUser.All
- If you are using Application context to make above call, you would need to assign Application permissions - Application.ReadWrite.OwnedBy, Application.ReadWrite.All
Please do not forget to "Accept the answer" wherever the information provided helps you. This will help others in the community as well.