I have a Powershell script that I want to use to copy a file from a domain server location up to an Egnyte folder. The file needs to be uploaded automatically so I am trying to use the Task Scheduler on a Server 2008 R2 server. The server has Egnyte Connect v. 126.96.36.199 installed and I have regular access to the Egnyte folder via a mounted drive letter "Y:". The Powershell scripts runs fine on its own if I use the drive letter but fails miserably when it runs through the Scheduler. I have tried using "\\egnytedrive\<domainaccount>@<Egnytedomain>\Shared\" but I receive an error telling me that the path doesn't exist. Any insight would be appreciated.
Hi @Irwin Matthies,
Can you try to change the \\egnytedrive\<domainaccount>@<Egnytedomain>\Shared\actual folder name ?
I suspect it might be a case of the file being attempted to be uploaded to directly under the Shared which is not permitted. The file has to go under some folder under the Shared.
Let me know if this helps.
For brevity's sake I trimmed the actual location down a bit. Here is the actual location (minus sensitive data) \\egnytedrive\<domainaccount>@<egnyte domain>\Shared\YCM\30 Day Folder\Distribution\. I've put the whole address in quotes (becasue of the spaces) and I've tried it with and without the final "\" as well. I also have permission to access the folders.
I am sorry I am no expert with powershell scripting, but just wondering if you could share your script and also the output of the error you are seeing when you attempt to copy the file.
Secondly, have you tried writing a file to any other network drive ? Does that work and if it does what destination format are you using there ?
I just need a snippet of the error or the output when the transfer fails. I will check with a few people I know to see how can we make this to work.
Sorry for the delay. Here is the error message:
VERBOSE: Performing operation "Copy File" on Target "Item:
\\egnytedrive\<domainuser>@<egnytedomain>\Shared\YCM\30 Day Folder\Distribution Centre".
copy-item : The network path was not found.
At E:\scripts\DeliveryList.ps1:45 char:1
+ copy-item $OutFile $MovePath -verbose
+ CategoryInfo : NotSpecified: (:) [Copy-Item], IOException
+ FullyQualifiedErrorId : System.IO.IOException,Microsoft.PowerShell.Commands.CopyItemCommand
I can run it without issue interactively but this is the message I get when I try running it through the Windows Scheduler.
Thankyou @Irwin Matthies,
Let me see what help I can get on this one. I will write back once I have something that can help.
I discussed this issue with my internal resources. Two things to be looked at.
- Is the Windows scheduler job running as administrator or as your profile?
If the job is running as admin, the drives won't be visible because the admin is considered a different user and our drives are not visible to other users on the same machine for security reasons.
- Or the scheduler should also run at the same time that our app is running (so the user should be logged in at the time)
Egnyte transforms business through smarter content allowing organizations to connect, protect, and unlock value from all their content.
© Egnyte, Inc. All Rights Reserved
If you can't find what you're looking for, contact Egnyte Customer Support.