The following tables show the least privileged permission or permissions required to call this API on each supported resource type. Follow best practices to request least privileged permissions. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
To delete the profile photo of the signed-in user
Permission type
Least privileged permissions
Higher privileged permissions
Delegated (work or school account)
ProfilePhoto.ReadWrite.All
User.ReadWrite, User.ReadWrite.All
Delegated (personal Microsoft account)
User.ReadWrite
Not supported.
Application
ProfilePhoto.ReadWrite.All
User.ReadWrite.All
To delete the profile photo of a group
Permission type
Least privileged permissions
Higher privileged permissions
Delegated (work or school account)
ProfilePhoto.ReadWrite.All
Group.ReadWrite.All
Delegated (personal Microsoft account)
Not supported.
Not supported.
Application
ProfilePhoto.ReadWrite.All
Group.ReadWrite.All
Not
Global admins, User admins, and People admins can delete the photo of any user in the organization using delegated permissions. This operation also supports application permissions. Deleting the photo of any user in the organization requires ProfilePhoto.ReadWrite.All or User.ReadWrite.All permissions. Deleting the photo of the signed-in user only requires User.ReadWrite permissions.
// Code snippets are only available for the latest version. Current version is 5.x// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharpawait graphClient.Me.Photo.Content.DeleteAsync();
// Code snippets are only available for the latest major version. Current major version is $v1.*// Dependenciesimport (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"//other-imports
)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
graphClient.Me().Photo().Value().Delete(context.Background(), nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
graphClient.me().photo().content().delete();
# Code snippets are only available for the latest version. Current version is 1.xfrom msgraph import GraphServiceClient
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=pythonawait graph_client.me.photo.content.delete()
Diğer geliştiriciler ve uzmanlarla gerçek dünyadaki kullanım örneklerini temel alan ölçeklenebilir yapay zeka çözümleri oluşturmak için toplantı serisine katılın.