To delete a shared file that you cannot access or remove, you can try the following steps:
- Check Permissions: Ensure that you have the appropriate permissions to delete the shared file. If you do not have the necessary permissions, you may need to contact the person who shared the file with you or the administrator of the shared workspace.
- Remove the Shared Folder: If the shared file is part of a shared folder, you can try to remove the entire shared folder from your OneDrive. To do this, you can use the following command in the OneDrive API:
This will remove the shared folder from your drive without deleting the folder or items contained in it for the original owner.DELETE /drive/items/{local-item-id} - Check for Errors: If you are receiving an error message when trying to delete, ensure that there are no retention policies or other restrictions in place that might be preventing deletion. You can refer to the retention policies in your organization that may affect file management.
- Use OneDrive Support: If the issue persists, consider reaching out to OneDrive support for assistance with the error you are encountering. They may be able to provide specific guidance based on the error message you are receiving.
- Try Different Devices: Since you mentioned trying both mobile and PC, ensure that you are using the latest version of the OneDrive app or accessing it through the web interface to see if the issue is device-specific.
If none of these steps work, it may be necessary to consult with your IT department or Microsoft support for further assistance.
References: