Hi There,
Environment: Latest MDT 2013 Update 1 and associated ADK
Due to network constraints our current deployments are mainly USB media based. Currently I am trying to automate as much as possible when deploying images. We have a couple of applications that require files to be copied into various locations and I have
some success using command line tasks\powershell tasks and adding the files and associated scripts as an application. What I am looking for is some advice on how others reliably achieve this in their deployments. Below is a summary of issues that I have with
the various methods I have tried.
Command Line Task- Using xcopy
Generally this method is the most reliable, however to access the files I have created a custom folder in %SCRIPTROOT%. The issue I have with this is MDT seems to use the Startup folder to copy the default scripts, this in turn also copies the custom folders
there also. Once the task sequence is complete I am left with the residue of these folders, which as they are left in startup, they launch an Explorer window at every logon. Basically it looks as if MDT is cleaning the scripts content that is default but not
the custom folders that it has also copied over. To combat this I have created another Powershell task to remove these folder. Is there another way that a USB media deploy can access another location such as %DEPLOYROOT% where I can place my custom folders
instead. I seem to remember not having much success using this as a variable in USB media. It works well if accessing the Deploymentshare over a network.
Powershell Task.
I have also tried copying files and removing using Powershell in a task, using Copy-Item\Remove-Item. Again varying results. It looks as if the locations that I am trying to copy to are an issue, protected locations. See below for where I am trying to copy
to locally.
C:\Windows\System32
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp
C:\ProgramData\Cisco\Cisco AnyConnect Secure Mobility Client\Profile
Import Powershell script as an application
Again I have had some success this way, however on some occasions it looks as if the application tasks fails. This may be down to my command or syntax in the Powershell script.
I would like to use powershell where possible, so I would be grateful if anyone can chip in reliable Commands that will be able to access protected locations to copy into and or remove items from using powershell. some commands I have used below:
Remove-Item -path "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\Cisco" -Recurse
# Removes the EducationShortcuts folder that gets copied from the Scriptroot folder
# Remove-Item "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\EducationShortcuts" -Recurse
# Removes Windows10Shortcuts folder and subfolder I hope
# Remove-Item "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\Windows10Shortcuts" -Recurse
Thanks in advance
Ewen