File copying works in Win10 but not in Win11

Pavel yannara Mirochnitchenko 11,716 Reputation points
2023-01-25T17:52:01.7566667+00:00

I have Intune managed computers and I am packaging simple Win32 app where I copy .exe file from package root to Public Desktop. It is Teamviewer app executable without installation process, a quick launcher basically. The challenge is, that copying works perfectly fine in Windows 10 machine, but not in Windows 11.

My powershell command looks like: *Copy-Item $PSScriptRoot\TeamViewerQS.exe -Destination $Env:Public\Desktop -Force -Verbose
*
I also tried cmd: xcopy TeamViewerQS.exe %Public%\Desktop

So Both fails from Intune Win32 app, but If I try same manually on Windows 11, I also can do the copying.

Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
8,164 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,364 questions
Microsoft Intune Application management
Microsoft Intune Application management
Microsoft Intune: A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.Application management: The process of creating, configuring, managing, and monitoring applications.
874 questions
Microsoft Intune
Microsoft Intune
A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.
4,334 questions
0 comments No comments
{count} votes

5 answers

Sort by: Most helpful
  1. Crystal-MSFT 42,961 Reputation points Microsoft Vendor
    2023-01-26T02:26:27.53+00:00

    @Pavel Yannara Mirochnitchenko, Thanks for posting in Q&A. From your description, it seems the PowerShell command we deployed via win32 is working on windows 10 but not windows 11. If there's any misunderstanding, feel free to let us know.

    To clarify our issue, please check the following information:

    1. Did it affect all the windows 11 devices? How did we configure "install behavior" on the win32 app?
    2. If the win32 app is installed under system account, to manually test it, we use PsExec to check if the PowerShell script can be run without user interact successfully. Could you confirm if we install the app under system account and if the manually test is run under PsExec?

    https://learn.microsoft.com/en-us/sysinternals/downloads/psexec

    1. Check the IntuneManagementextension.log to see which phase it is failed.

    https://call4cloud.nl/2021/05/imecache-attack-of-the-cleaner/

    Please check the above information and if there's any update, feel free to let us know.


    If the answer is helpful, 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.


  2. Limitless Technology 43,931 Reputation points
    2023-01-26T17:09:02.52+00:00

    Hi. Thank you for your question and reaching out. I’d be more than happy to help you with your query.

    There are a few reasons why your Win32 app package may not be copying the executable file to the Public Desktop on Windows 11 machines when it works on Windows 10 machines:

    1. Permission issues: Windows 11 has stricter security measures in place, which may prevent the package from copying files to certain locations without the proper permissions. Make sure that the app has the necessary permissions to copy files to the Public Desktop.
    2. File system redirection: Windows 11 has introduced a new feature called file system redirection, which redirects access to certain files and folders to another location. This may prevent the package from finding the Public Desktop folder in its expected location.

    In addition, it's likely that the issue you're experiencing is related to changes in the operating system's security settings or file system structure between Windows 10 and Windows 11. In Windows 11, the Public Desktop folder may be located in a different location or have different permissions than in Windows 10.

    One solution to this issue would be to use the Intune Management Extension to deploy the Teamviewer app executable to the appropriate location on Windows 11 machines. The Intune Management Extension allows you to run scripts and other commands on managed devices, which would allow you to copy the executable to the correct location on the target machine.

    Another solution would be to configure the Intune app deployment with the correct path of the folder where you want to copy the Teamviewer executable.

    You can also check the event viewer for any error related to the copy action.

    If the reply was helpful, please don’t forget to upvote or accept as answer, thank you.

    0 comments No comments

  3. Limitless Technology 43,931 Reputation points
    2023-01-26T17:09:40.49+00:00

    Double post

    0 comments No comments

  4. Pavel yannara Mirochnitchenko 11,716 Reputation points
    2023-01-28T09:10:51.6866667+00:00

    In my lab, same package works for Windows 11 as well :D

    I will re-import the win32 package in the problematic enviroment and see if that will work out then.

    0 comments No comments

  5. Pavel yannara Mirochnitchenko 11,716 Reputation points
    2023-01-31T06:15:59.7533333+00:00

    @Crystal-MSFT I re-created new intunewin without changes and it worked...