using takeown in a script

Welcome Forums General PowerShell Q&A using takeown in a script

This topic contains 1 reply, has 2 voices, and was last updated by

 
Participant
2 years, 3 months ago.

  • Author
    Posts
  • #50106

    Participant
    Points: 0
    Rank: Member

    Hi,

    I'm trying to write a script that copies the contents of a users Redirected Folder to a freshly created folder with a new name (automated when a user changes their name). We use the strictest permissions due to the nature of the business and therefore admins don't have access to the original folder.

    I'm going to use takeown on the original folder so that the script has the right permissions. My question, as some folders are in the 40gb (I know!!) region, is: Will PowerShell wait until the takeown has finished before moving onto the next command, or will I have to include a Wait command?

    Thanks
    Tony

  • #50431

    Participant
    Points: 0
    Rank: Member

    PS will wait takeown....
    but you ruine ALL of your security with takeown

    I believe you should use robocopy for this task

The topic ‘using takeown in a script’ is closed to new replies.