[GH-ISSUE #49] Access to the cloud file denied #16

Closed
opened 2026-02-27 20:30:49 +03:00 by kerem · 7 comments
Owner

Originally created by @dakolta on GitHub (Aug 10, 2022).
Original GitHub issue: https://github.com/Set-OutlookSignatures/Set-OutlookSignatures/issues/49

Originally assigned to: @dakolta, @GruberMarkus on GitHub.

Rolled out Set-OutlookSignatures to a new user and got the following error:

Copy signatures to AdditionalSignaturePath @2022-08-10T09:11:17-04:00@
  'C:\Users\jvogel\OneDrive - Developer's Mortgage Company\Documents 2\Documents\Outlook Signatures'
PS>TerminatingError(Remove-Item): "Access to the cloud file is denied"
>> TerminatingError(Remove-Item): "Access to the cloud file is denied"

Unexpected error. Exit.
Remove-Item : Access to the cloud file is denied
At C:\drivers\desktops\Set-OutlookSignatures\Set-OutlookSignatures.ps1:2138 char:91
+ ... .fullname | Remove-Item -Recurse -Force -Confirm:$false -ErrorAction  ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Remove-Item], Win32Exception
    + FullyQualifiedErrorId : System.ComponentModel.Win32Exception,Microsoft.PowerShell.Commands.RemoveItemCommand


Clean-up @2022-08-10T09:11:17-04:00@

End script @2022-08-10T09:11:17-04:00@

Originally created by @dakolta on GitHub (Aug 10, 2022). Original GitHub issue: https://github.com/Set-OutlookSignatures/Set-OutlookSignatures/issues/49 Originally assigned to: @dakolta, @GruberMarkus on GitHub. Rolled out Set-OutlookSignatures to a new user and got the following error: ``` Copy signatures to AdditionalSignaturePath @2022-08-10T09:11:17-04:00@ 'C:\Users\jvogel\OneDrive - Developer's Mortgage Company\Documents 2\Documents\Outlook Signatures' PS>TerminatingError(Remove-Item): "Access to the cloud file is denied" >> TerminatingError(Remove-Item): "Access to the cloud file is denied" Unexpected error. Exit. Remove-Item : Access to the cloud file is denied At C:\drivers\desktops\Set-OutlookSignatures\Set-OutlookSignatures.ps1:2138 char:91 + ... .fullname | Remove-Item -Recurse -Force -Confirm:$false -ErrorAction ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Remove-Item], Win32Exception + FullyQualifiedErrorId : System.ComponentModel.Win32Exception,Microsoft.PowerShell.Commands.RemoveItemCommand Clean-up @2022-08-10T09:11:17-04:00@ End script @2022-08-10T09:11:17-04:00@ ```
kerem closed this issue 2026-02-27 20:30:50 +03:00
Author
Owner

@GruberMarkus commented on GitHub (Aug 10, 2022):

This seems to be a problem caused by the Files-On-Demand feature of OneDrive.

Disable the Files-On-Demand Feature, wait until the sync completed and let me know if the problem is still there.

<!-- gh-comment-id:1210811505 --> @GruberMarkus commented on GitHub (Aug 10, 2022): This seems to be a problem caused by the Files-On-Demand feature of OneDrive. Disable the Files-On-Demand Feature, wait until the sync completed and let me know if the problem is still there.
Author
Owner

@GruberMarkus commented on GitHub (Aug 10, 2022):

Also, use the latest version of Set-OutlookSignatures for your tests (the error message does not come from the most recent version v3.2.1, as the line numbers do not match).

<!-- gh-comment-id:1210834563 --> @GruberMarkus commented on GitHub (Aug 10, 2022): Also, use the latest version of Set-OutlookSignatures for your tests (the error message does not come from the most recent version v3.2.1, as the line numbers do not match).
Author
Owner

@GruberMarkus commented on GitHub (Aug 14, 2022):

I can't reproduce the problem on my systems, but have found a possible workaround in the internet.

Let me know if the attached alpha version works. Run it with the '-verbose' parameter and post the whole script output.

Set-OutlookSignatures.ps1.txt

<!-- gh-comment-id:1214407746 --> @GruberMarkus commented on GitHub (Aug 14, 2022): I can't reproduce the problem on my systems, but have found a possible workaround in the internet. Let me know if the attached alpha version works. Run it with the '`-verbose`' parameter and post the whole script output. [Set-OutlookSignatures.ps1.txt](https://github.com/GruberMarkus/Set-OutlookSignatures/files/9333684/Set-OutlookSignatures.ps1.txt)
Author
Owner

@GruberMarkus commented on GitHub (Aug 16, 2022):

Update: Use v3.3.0-alpha1 or a newer version for your tests.

<!-- gh-comment-id:1216299826 --> @GruberMarkus commented on GitHub (Aug 16, 2022): Update: Use v3.3.0-alpha1 or a newer version for your tests.
Author
Owner

@dakolta commented on GitHub (Aug 19, 2022):

Sorry for the delay, had a hard time getting the user to leave that computer on.
Here is a full text from the running of the script.
SetSig.txt

<!-- gh-comment-id:1220796366 --> @dakolta commented on GitHub (Aug 19, 2022): Sorry for the delay, had a hard time getting the user to leave that computer on. Here is a full text from the running of the script. [SetSig.txt](https://github.com/GruberMarkus/Set-OutlookSignatures/files/9383241/SetSig.txt)
Author
Owner

@GruberMarkus commented on GitHub (Aug 19, 2022):

The log file shows that the workaround seems to solve the problem.

The error messages regarding DLL files which can not be deleted are expected, they happen because of PowerShell and .Net restrictions.

Version 3.3.0-alpha2, which will no longer show these expected error messages, will be released in a few minutes. Release v3.3.0-alpha2 will deploy signatures for automapped and additional mailboxes per default, see CHANGELOG and README for details.

You may want to have a look at the '-GraphOnly true' parameter, if all the information relevant for Set-OutlookSignatures can be found in Microsoft Graph and no connection to an Active Directory instance on-prem is required.

<!-- gh-comment-id:1220931259 --> @GruberMarkus commented on GitHub (Aug 19, 2022): The log file shows that the workaround seems to solve the problem. The error messages regarding DLL files which can not be deleted are expected, they happen because of PowerShell and .Net restrictions. Version 3.3.0-alpha2, which will no longer show these expected error messages, will be released in a few minutes. Release v3.3.0-alpha2 will deploy signatures for automapped and additional mailboxes per default, see CHANGELOG and README for details. You may want to have a look at the '-GraphOnly true' parameter, if all the information relevant for Set-OutlookSignatures can be found in Microsoft Graph and no connection to an Active Directory instance on-prem is required.
Author
Owner

@GruberMarkus commented on GitHub (Aug 20, 2022):

Closing, as v3.3.0-alpha2 and newer use an alternative approach to delete files and folders that possibly reside on OneDrive. This alternative approach avoids the "access to the cloud file is denied" error.

<!-- gh-comment-id:1221214447 --> @GruberMarkus commented on GitHub (Aug 20, 2022): Closing, as v3.3.0-alpha2 and newer use an alternative approach to delete files and folders that possibly reside on OneDrive. This alternative approach avoids the "access to the cloud file is denied" error.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Set-OutlookSignatures-Set-OutlookSignatures#16
No description provided.