I am trying to copy files from share server but not able to do it.

  • 5 August 2021
  • 3 replies
  • 159 views

hey everyone,


I have been trying to get the copy file to work. but on the Automox it shows it was copied but it is not. when I ran the scripted locally with x86 it looks to be able to copy the files.


Copy-Item -Path ‘\servername\freenas4\installs\VPN Certs*’ -Destination ‘c:\ProgramData\Cisco\Cisco AnyConnect Secure Mobility Client\Profile’ -PassThru


3 replies

Badge

You could probably use this worklet to achieve what you’re doing without much hassle. You’ll have to upload the file to Automox though.

Thank you

Userlevel 3
Badge

Here is the remediation for a worklet we are using to install a very large Autodesk package that we copy from an internal server. It works great. You need to make sure that the share has permission set for Authenticated Users since this is running under system using the computer account for authentication.


##Copy installer from local share. Package download times out when installer is included in policy

#Handle Exit Codes:
trap { $host.ui.WriteErrorLine($_.Exception); exit 90 }

###### Installing application on system ######
Try {
if (Test-Path -Path "C:\Program Files\Autodesk\webdeploy") {
Copy-Item "\\tyger\Deploy$\Autodesk\Fusion 360 Admin Install.exe" -Destination ".\Fusion 360 Admin Install.exe"
Start-Process -FilePath 'Fusion 360 Admin Install.exe' -ArgumentList ('--process uninstall --quiet') -Wait
Start-Process -FilePath 'Fusion 360 Admin Install.exe' -ArgumentList ('--quiet') -Wait
Write-Output "Fusion 360 Admin Install.exe..."
}
}
Catch { $Exception = $error[0].Exception.Message + "`nAt Line " + $error[0].InvocationInfo.ScriptLineNumber
Write-Output $Exception
exit 90
}

Reply