Task Schduler that runs powershell script does not move the folder s3 bucket

Sinem A 6 Reputation points
2022-03-17T15:16:50.62+00:00

Hi all,

I have a PowerShell script that move a folder, that contains csv files and a txt, from shared folder to s3 Bucket. I have trouble about moving it to s3 bucket when it run automatically by task scheduler without giving any error. But when I run the task scheduler manually it can send to folder to s3.

Copy and paste did not work, I guess. Here is the screen shot of it;

184813-a.png

Basically, script takes the xlsx files from shared folder (FileUpload), create new csv files from them in FileDownload and create a folder for new csv files and move folder to s3 bucket but as I mentioned job cannot move the folder to s3 bucket when it run automatically by task scheduler without giving any error. But when I run the task scheduler manually it can send to folder to s3.

Also “Run whether use is logged on or not” is selected in task scheduler.

Program: Powershell.exe
Add Arguments: -ExecutionPolicy Unrestricted -File "F:\Data Upload\ScriptConverttoCSVNew.ps1"

I have very limited information about both PowerShell and s3 bucket. Any help will be appreciated. I searched the problem but I could not find a solution

Thanks in advance
SinemA

Windows for business Windows Server User experience PowerShell
0 comments No comments
{count} vote

4 answers

Sort by: Most helpful
  1. Rich Matheisen 47,901 Reputation points
    2022-03-17T18:28:32.66+00:00

    Under what account is the scheduled task run?
    Are the two shares on the machine running the scheduled task, or are they located on some other machine?
    Will the ACL on the shares (and the underlying directory structure) permit access to the account running the scheduled task?

    There is no error checking or handling in your script. Do you know if there are any errors in its execution when it runs as a scheduled task?

    0 comments No comments

  2. Sinem A 6 Reputation points
    2022-03-18T11:38:33.85+00:00

    The scheduled task is running by SERVICES which is a domain account.
    Shared folder under a server and task scheduler under another server.
    As I learned from our system supervisor, all the permission is given as full permission to the related accounts.

    I checked the history of the task scheduler, I did not see any error during execution, unfortunately.

    Thank you in advance


  3. Rich Matheisen 47,901 Reputation points
    2022-03-19T15:05:15.54+00:00

    Is the scheduled task using the account SERVICE?

    Does that account have permission to launch DCOM stuff?

    Are you running this scheduled task on a server or workstation?

    Instead of monkeying around with Excel a d COM, a better (i.e. portable, doesn't need Excel to be installed on the machine, more secure, etc.) way would be to install the PowerShell module **ImportExcel.*

    0 comments No comments

  4. Sinem A 6 Reputation points
    2022-03-25T11:59:32.53+00:00

    Yes it seems that the problem is to create csv file step of the job by task scheduler

    I am trying to use ImportExcel powershell module

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.