anyweb Posted October 23, 2010 Report post Posted October 23, 2010 Let's say you want to copy some files from a package to your target computer, should be simple enough right ? In the following Task Sequence, copying files from packages - access.xml copying files from packages - access.xml we reference a package (called copy_files) which contains some blank files and folders copy_files.zip We have two groups in this simple task sequence, the first group copies all files from a package to a directory on your target computer (the computer that you run the task sequence on). The first step in the group creates the target folder if it doesn't exist, via a command line cmd.exe /c md c:\somedir To check if the folder already exists, you have to look at the options tab of that step The second step actually copies the files by referencing our copy_files package, the clever part here is the .\ infront of our path. so the command line to do the copying is as follows xcopy.exe ".\*.*" "c:\somedir" /D /E /C /I /Q /H /R /Y /S The second group in the task sequence is similar to the first except that it creates somedir2 and it only copies the TXT files from our selected package. (This is deliberate so that you can see what happens next..) Note: In the screenshot of the step above, I am deliberatly NOT including the .\ in front of the path, this is to show you how an advertisements distribution points settings can change the way command lines function. the xcopy command in the second group is as follows xcopy.exe "*.txt" "c:\somedir2" /D /E /C /I /Q /H /R /Y /S Quote Share this post Link to post Share on other sites More sharing options...
anyweb Posted October 23, 2010 Report post Posted October 23, 2010 Advertise the Task Sequence Import the task sequence into configmgr and create the copy_files package using the package included in the post above. don't forget to distribute that package to your distribution points. Once ready, we will then advertise our Task Sequence. In Task Sequences, select the imported task sequence, right click on it and choose Advertise When the New Advertisement Wizard begins, select your All Windows XP collection (or whichever one you are testing with) and click next leave schedule as it is, make no changes For distribution settings, choose access content directly from a distribution point when needed by the running task sequence for Interaction, choose show the task sequence progress click next through the wizard to finish. Quote Share this post Link to post Share on other sites More sharing options...
anyweb Posted October 23, 2010 Report post Posted October 23, 2010 Duplicate the Task Sequence Right click on our selected task sequence again, but this time choose Duplicate you will be informed when the duplication is done, click Ok. Right click on the task sequence, choose properties and change the name to copying files from packages - download We now have our second Task Sequence and it is identical to the first except for the name (the reason of which will become clear soon). Create a New Advertisement Create a new advertisement for the copying files from packages - download task sequence as we did above except for the distribution settings do as follows:- Choose the following setting download content locally when needed by running task sequence Quote Share this post Link to post Share on other sites More sharing options...
anyweb Posted October 23, 2010 Report post Posted October 23, 2010 Run the first Advertisement from RAP Now that we have done all the hard work, let's test it on the client, open up RAP (Run Advertised Programs) and select the first Advertisement which is called copying files from packages - access Let the advertisement complete and then check your c:\ for the results when finished we'll see our two directories created, the first dir (somedir) should contain all files from the copy_files package, and indeed it does We would naturally expect the second dir (somedir2)to only contain the TXT files from the copy_files package, but to our surprise it contains possibly hundreds of folders all marked with your site code, infact, these folders are every single package on your site server (and thankfully only the TXT files are copied, now do you see why I selected only the TXT files ) Quote Share this post Link to post Share on other sites More sharing options...
anyweb Posted October 23, 2010 Report post Posted October 23, 2010 Run the second advertisement from RAP Now that we've seen what the access content directly from Distribution Points setting does in relation to file copy, let's run the other advertisement, but before we do, delete the somedir and somedir2 directories Choose the copying file from packages - download task sequence and run. this task sequence will execute much quicker than the first when done, check c:\somedir, it contains all files and folders as we would expect from the package and finally check c:\somedir2 note how it ONLY contains the text files from our copy_file package, exactly as we expected originally, and this is all down to our Distribution Point settings in our Advertisement ! Interesting huh ? try it for yourself and share your results please cheers niall Quote Share this post Link to post Share on other sites More sharing options...
Eswar Koneti Posted October 26, 2010 Report post Posted October 26, 2010 Really Interesting...... I think it downloads all the content packages from DP based on the Criteria given in the commandline but also it copies all the DP content even if the folder doesnt have .txt files. In this case(with option access content directly ),is there any importance or usage for the package (copy files package) used ? will this happen to all the advertised TS on the clients if we select access content directly ? Quote Share this post Link to post Share on other sites More sharing options...
Peter van der Woude Posted October 26, 2010 Report post Posted October 26, 2010 It's to show the behaviour of doing file copies from a package during a Task Sequence. Quote Share this post Link to post Share on other sites More sharing options...
Kirachan Posted May 2, 2012 Report post Posted May 2, 2012 How would you change this task sequence to work with a task sequence that is being used to image a machine? It seems that it doesn't like writing files to any place other than the public user directory. Quote Share this post Link to post Share on other sites More sharing options...
killiandw Posted June 2, 2015 Report post Posted June 2, 2015 I am trying to use this method during OSD to copy a files onto the local HD. Does the target computer need to be joined to the domain for this method to work? Quote Share this post Link to post Share on other sites More sharing options...
Peter van der Woude Posted June 2, 2015 Report post Posted June 2, 2015 No it doesn't has to be domain joined. It only needs to be able to communicate with ConfigMgr (MP/DP) and a network access account has to be configured in ConfigMgr to access the DP. Quote Share this post Link to post Share on other sites More sharing options...
killiandw Posted June 3, 2015 Report post Posted June 3, 2015 No it doesn't has to be domain joined. It only needs to be able to communicate with ConfigMgr (MP/DP) and a network access account has to be configured in ConfigMgr to access the DP Can this be done during OSD? Quote Share this post Link to post Share on other sites More sharing options...