locked
Copy multiple paths file on a remote computer by same domain powershell RRS feed

  • Question

  • Hey guys,

    I need to copy the user folder such as Favorites, Documents and Desktop that are located in the old PC in to new user PC to same destination using PowerShell. The users are in the same domain. As it admin I have all credentials to do it but I'm new in PowerShell. Might be could you help me. Kindly regards and I appreciate in advance.

    Tuesday, November 5, 2019 9:01 AM

All replies

  • Marius,

    please carefully review the Forum Posting Guidelines before you proceed. There you will find all information needed for beginners.

    Good luck and have a lot of fun!


    Live long and prosper!

    (79,108,97,102|%{[char]$_})-join''

    Tuesday, November 5, 2019 9:09 AM
  • Hi,

    Thanks for your question.

    About how to copy the files remotely by powershell.

    https://blogs.msdn.microsoft.com/luisdem/2016/08/31/powershell-how-to-copy-a-local-file-to-remote-machines/

    For example:

    $cred=get-credential
    $Session = New-PSSession -ComputerName PowerShellAzureMachine -Credential $cred
    Copy-Item -Path C:\temp\localfile.txt -Destination C:\localfile.txt -ToSession $session

    Or invoke-command.

    Best regards,

    Lee


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Tuesday, November 5, 2019 12:12 PM
  • Hey Lee,

    I'll try and let se what happened, like I said, I'm novice in PowerShell. 

    Kindly regards and sanks again, appreciate your time. 

    Wednesday, November 6, 2019 8:26 AM
  • Hi,

    Was your issue resolved?

    If you resolved it using our solution, please "mark it as answer" to help other community members find the helpful reply quickly.

    If you resolve it using your own solution, please share your experience and solution here. It will be very beneficial for other community members who have similar questions.

    If no, please reply and tell us the current situation in order to provide further help.

    Best Regards,

    Lee


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Friday, December 6, 2019 9:47 AM