using takeown in a script

This topic contains 1 reply, has 2 voices, and was last updated by Profile photo of Max Kozlov Max Kozlov 11 months, 1 week ago.

  • Author
  • #50106
    Profile photo of Tony Wainwright
    Tony Wainwright


    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?


  • #50431
    Profile photo of Max Kozlov
    Max Kozlov

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

    I believe you should use robocopy for this task

You must be logged in to reply to this topic.