SQL Agent job running DTS package running in SQL 2005 is unable to run if job onwer is not logged onto server

I am currently working on a SQL Server upgrade project for a a client where I am converting old dts packages to SSIS. However for a few of the packages no conversion is allowed to be done. For these few packages I have to use dts legacy components in SQL
2005 on a windows 2003 server to run them.
These packages use CAPICOM via an Active X script in the package to envelope connection string data for security within the package. Consequently I have to register the capicom.dll for the job owner (which will execute the job via proxy) and install private
and public key files via internet explorer. I also do this when I am logged in with my account so i can test the package.
I have created a SQL Server Agent Job which is used to execute the package. We have a schedule account which is local admin on the server and sysadmin within SQL Server. This account is used to create a credential and then a proxy for the CmdExec subsystem
is then created based on this credential. A CmdExec job step is then added to the job. The directory of  cmd file which calls the dts package is then entered in the command window.
Finally a recurring schedule is added to execute the job every 5 minutes. 
If i am logged in to the server using the scheduled account the schedule runs successfully. I am also able to run the command file manually by double clicking on it. The DTS package is run successfully. However once the schedule is set up and I log off the
machine and log onto my development machine with my normal account and fire up  SQL Server. I connect to that instance with the schedule and see that the job is failing with and Active X error in the package. From experience with this package this Active
X  error occurs when the user executing the package has not registered the capicom.dll. This has already been done for the scheduler account because the job runs when the scheduler account is logged in on the server. 
It almost seems as though the job will only run if the Scheduler account is logged on. If i log directly on to the server with own user account I am able to manually execute the package via the cmd file which indicates that the capciom.dll is registered
under my account. Yet if I try an run the job in SQL Server when I am logged in under my account (using the scheduler account proxy) then the job fails.
Does anybody have any idea why this may be happening? Any ideas would be much appreciated

Run the job SSIS step under a proxy account that is derived from the domain account, non-expiring password and has been set to have all the necessary rights.
How to is here: http://www.mssqltips.com/sqlservertip/2163/running-a-ssis-package-from-sql-server-agent-using-a-proxy-account/
Arthur
MyBlog
Twitter

Similar Messages

  • Problem Running SSIS Package with a SQL Server Agent

    SQL Server: SQL Server 2012
    VS: Visual Studio 2012
    Hello,
          I have been having a problem running SSIS packages by using a SQL Server Agent job. I first created these SSIS packages in a separate IS project in Visual Studio. I imported the packages to the Integration Services (Package
    Store) instance on my SQL Server and tried to create a job that would run them from there.
          At first I read around about needing a proxy account to allow the agent/packages to access the file system since these packages are importing data from a flat file in the SQL database. So I created a temporary admin user to
    use as the user for the agent. I did this by going to Services.msc on the server and linked the account the agent's "logon as". Then arose another issue where I am getting an error about using the incorrect type for my connection managers.
    The connection manager "TestFile" is an incorrect type.  The type required is "OLEDB". The type available to the component is "FLATFILE". Source: Data Flow Task Flat File Destination [2]     Description:
    Cannot open the datafile "O:\*****\Success.txt"
    I am not sure what this even means as I am getting this error even with a test package that doesn't do anything with the database. I have just two flat file connection managers  in this test project one for grabbing the source file and one for
    creating the new test file.
    I am not sure what to do.
    Thanks in advance,
    Matt

    I accidently created two posts. The newest one has the details.
    I did not mean to.
    SQL Server: SQL Server 2012
    VS: Visual Studio 2012
    Hello,
          I have been having a problem running SSIS packages by using a SQL Server Agent job. I first created these SSIS packages in a separate IS project in Visual Studio. I imported the packages to the Integration Services (Package
    Store) instance on my SQL Server and tried to create a job that would run them from there.
          At first I read around about needing a proxy account to allow the agent/packages to access the file system since these packages are importing data from a flat file in the SQL database. So I created a temporary admin user to
    use as the user for the agent. I did this by going to Services.msc on the server and linked the account the agent's "logon as". Then arose another issue where I am getting an error about using the incorrect type for my connection managers.
    The connection manager "TestFile" is an incorrect type.  The type required is "OLEDB". The type available to the component is "FLATFILE". Source: Data Flow Task Flat File Destination [2]     Description:
    Cannot open the datafile "O:\*****\Success.txt"
    I am not sure what this even means as I am getting this error even with a test package that doesn't do anything with the database. I have just two flat file connection managers  in this test project one for grabbing the source file and one for
    creating the new test file.
    I am not sure what to do.
    Thanks in advance,
    Matt

  • Running DTS package through JSP application

    Hi
    I am working on a web application using JSP. I need to run a dts package(SQL Server 2000 ) on each clicking of a button and also pop up a donload window for the file generated by this dts.
    The dts package is saved in "C:\Classification" folder on server and the file generated by this dts is also saved in this location.
    I tried a lot to get some help on this regard but could not get any . So any kind of suggestion or code or any stuffs may help me a lot.
    Thank u

    hello,
    you just want to serve a file from a servlet??
    set the good mime type of the response
    then write your file binary to the output stream of the response
    //in your servlet
    response.setContentType("<mime type of dts >");
    OutputStram out=response.getOutputStream();
    InputStream in = new FileInputStream("C:\\Classification\\<yourfile>");
    IOUtils.copy(in, out);  //you'll find this one in the commons-io package, on the apache website
    in.close();
    out.close();for the "pop up" thing... it's a client side (html/javascript) matter

  • SQL agent scheduling for SSIS package

    I have a package with a souce and destination connection using login as 'sa'.
    I created a scheduling task to call this package for running. However the sql agent service is running as domain user . It required to be running as domain user as per requirement.
    Thus when I scheduling the package for execution, it hit error.
    Please advise what I can do in order to be able schedule the ssis package?
    Thanks in advance.

    Here is the step that I create the proxy :
    https://www.simple-talk.com/sql/database-administration/setting-up-your-sql-server-agent-correctly/
    I try to create the proxy but still have error as below:
    Executed as user: YS2H\svr_agent. Microsoft (R) SQL Server Execute Package Utility  Version 10.50.2500.0 for 32-bit  Copyright (C) Microsoft Corporation 2010. All rights reserved.    Started:  8:21:26 AM  Error: 2015-03-27
    08:21:26.24     Code: 0xC0016016     Source:       Description: Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B "Key not valid for use in specified
    state.". You may not be authorized to access this information. This error occurs when there is a cryptographic error. Verify that the correct key is available.  End Error  Error: 2015-03-27 08:21:26.44     Code: 0xC0016016    
    Source:       Description: Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B "Key not valid for use in specified state.". You may not be authorized to access this information. This error
    occurs when there is a cryptographic error. Verify that the correct key is available.  End Error  Error: 2015-03-27 08:21:27.03     Code: 0xC0202009     Source: 1001_Import_DownloadRoadCard Connection manager
    "Destination"     Description: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80040E4D.  An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 10.0" 
    Hresult: 0x80040E4D  Description: "Login failed for user 'sa'.".  End Error  Error: 2015-03-27 08:21:27.03     Code: 0xC00291EC     Source: Evaluate Completion Status Execute SQL Task    
    Description: Failed to acquire connection "Destination". Connection may not be configured correctly or you may not have the right permissions on this connection.  End Error  Error: 2015-03-27 08:21:27.05     Code: 0xC0202009    
    Source: 1001_Import_DownloadData Connection manager "Destination"     Description: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80040E4D.  An OLE DB record is available.  Source:
    "Microsoft SQL Server Native Client 10.0"  Hresult: 0x80040E4D  Description: "Login failed for user 'sa'.".  End Error  Error: 2015-03-27 08:21:27.05     Code: 0xC00291EC     Source:
    Record Start of Job Execute SQL Task     Description: Failed to acquire connection "Destination". Connection may not be configured correctly or you may not have the right permissions on this connection.  End Error  DTExec:
    The package execution returned DTSER_FAILURE (1).  Started:  8:21:26 AM  Finished: 8:21:27 AM  Elapsed:  0.983 seconds.  The package execution failed.  The step failed.
    Thanks for your help.

  • SQL Server Agent Job intermittently running for packages on SSISDB

    I created an SSIS package to pull data from OLAP Cube and push it into SQL Server using SSIS 2o12. I deployed the same on the SQL Server SSIS DB and created a SQL Server Agent Job to run the package. I have an account configured to run the job (not by
    creating proxy in the job, but SQL Server Agent is running under that account), that has access to the OLAP Cube. The job is running sometimes and failing sometimes. Why the job behaving weirdly. Any help on the issue will help me a lot. I am using SQL Server
    2012 SP1 enterprise edition (11.0.3000.0) (if it helps). The error message which pops up when it fails is :
    OLE DB Source failed the pre-execute phase and returned error code 0xC0202009
    SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80040E05.
    An OLE DB record is available.  Source: ""Microsoft OLE DB Provider for SQL Server 2012 Analysis Services.""  Hresult: 0x00000001  Description: ""Error Code = 0x80040E05, External Code = 0x00000000:."".
    "

    Hi,
    You are using Execute SQL Task to run a MDX query, right?  If so, here is an approach/workaround for your reference. If the MDX query doesn’t have parameters, you can create a view in SQL running the MDX query and make the Execute SQL Task to get data
    from that view. If the MDX query has parameters, you can try a Function and create a stored procedure, and then set the Execute SQL Task to execute that stored procedure.
    Regards,
    Mike Yin
    TechNet Community Support

  • Unable to Run SSIS Package Through SQL Agent Job

    Hi,
    I recently upgraded SQL server 2008 R2 to SQL Server 2012. I also upgraded all the packages on the server. The package runs fine from BIDS. However when I try to run the package through the SQL Agent Job it fails with the error below:
    Executed as user: A. Microsoft (R) SQL Server Execute Package Utility  Version 11.0.2100.60 for 64-bit  Copyright (C) Microsoft Corporation. All rights reserved.    Started:  11:43:04 PM  Could not load package "\FolderA\Package.dtsx"
    because of error 0xC00160AE.  Description: Connecting to the Integration Services service on the computer "S2345WE" failed with the following error: "Access is denied."    By default, only administrators have access to the
    Integration Services service. On Windows Vista and later, the process must be running with administrative privileges in order to connect to the Integration Services service. See the help topic for information on how to configure access to the service.  Source:
      Started:  11:43:04 PM  Finished: 11:43:04 PM  Elapsed:  0.016 seconds.  The package could not be loaded.
    Using Windows Authentication I am able to login to Integration services through SSMS. In the SQL Agent job I am using package store to execute the package. I have admin permission on the server. The integration services currently uses my credentials while
    running.I am not sure why I am getting this error.
    Please advice..
    Thanks,
    EVA05

    Hi ,
    similar thread - http://social.technet.microsoft.com/Forums/en-US/sqlintegrationservices/thread/25e22c7e-bae0-42e4-b86d-2db7a4af519d
    Try this link -
    http://msdn.microsoft.com/en-us/library/dd440760%28v=sql.100%29.aspx
    sathya --------- Please Mark as answered if my post solved your problem and Vote as helpful if my post was useful.

  • SSIS Package runs from the Package executer and from BIDS but not from the sql agent schedular

    Hi Experts,
    I have 2 packages :
    1. Main Package -For each loop package
    2. Sub Package - As we need to collect the information from several other DB with same table structures .
    The Main Package calls the Sub Package and loops through several linked server (9 of them ) .
    From last 2 weeks the scheduler is running on time but no data is loaded into our destination DB . 
    Daily i need to manually run the package .
    The SQL Agent task is scheduled using the service account from which  the sql server was installed on the server so it has the full privledges.
    If i run the Main package from the BIDS i see 2 messages related to the configuration of xml no error message and executes fine.
    If i run the Package from the execute package utility it runs fine.
    Now if the package is scheduled for a nightly load it executes fine successfully no error message also in the Job History
    but when i check for the data loaded on that day no data loads up in the destination DB . Due to this behavior of the sql agent even if am on leave i have to login on to the server and exec manually so if at times i forget the exec we are in big trouble
    Please experts help me in troubleshooting the issue.
    Thanks
    Priya

    Hi Visakh16 ,
    We are using a service account to run the package .. Earlier in the BIDS i was getting the error crypotgenic
    something password .. I googled out and changed the security : Protection Level : Dont save Sensitive
    information . So that error now its not showing in the BIDS
    And how is login mapping done for the linked servers?  You've configured a mapped login for the service account also?
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Package hangs when exporting data to Access DB when running under SQL agent & proxy - works fine under BIDS

    Hi all - - I have searched every nook & cranny to find a similar issue, but the ones I have found have not solved my problem.
    I have a simple package that exports data from a SQL database (2008R2) to several Access databases (Client needs them to be mdb, not accdb).  The whole thing works fine in BIDS, but even though we have created a proxy for the SQL agent, the job runs
    without throwing an error, updates the time stamp on the databases, but does not do anything to them.  I created a log file with both the BIDS version & SQL agent version, and the logs look very similar, except that the BIDS one is about 3 times longer.
     The SQL agent one shows no obvious errors or issues.
    I do have the Access database engine installed on both the server where the SQL agent is running as well as my development environment.
    The job does have the 32 bit runtime option checked as well.
    The DBAs are working on the proxy & permissions, and I am wondering if they have missed something in that arena, or if there is something else I may have missed in settings on the package?
    We have been beating on this for days now, so any help would be greatly appreciated.
    Thanks,
    John

    Hi John,
    Not sure what "but does not do anything to them" means, but I believe once you start running your job with a domain account based proxy it must work (JET uses Admin behind the scenes to actually manipulates on the db that needs to be impersonated).
    Arthur My Blog

  • Problem with running a DTS package from CF Code

    i am using a CFQUERY Tag with EXEC dbo.storedprocname to
    execute a stored procedure on our sql server which runs a DTS
    package. the cf template allows them to upload a text file to the
    server for import to a sql table via this DTS package. the problem
    is that if the DTS package fails - it does nto notify the user
    runnign the CF template. is there any way to notify the user when
    the DTS package fails?

    well the size of the data file being import varies widely.
    the import is to be run daily but some days it might contain 10
    records and some days it might contain 10,000. the dts package
    itself generally takes a few seconds to process and the CF template
    takes around 5-10 seconds to complete.
    so if i were to add a dts task to the end of my work flow to
    update a table with a status message, that might work, but how
    would i capture the status of the dts import task?
    as for the asynchronous gateway, i don't think that would
    work for me, the user would want more immediate feedback, they
    would not wait for an email confirmation (the target users have
    trouble figuring out how to use email as it is - they are not the
    most computer savvy). so likely if i could get the dts package to
    write a status message to a table, then i would just add a cfquery
    to my cf template after the one that runs the dts package, and
    check for the status message and output it to the screen.
    but the key is how do i add a dts task to grab the status of
    the dts import task and drop it in a table.

  • Ssis/sql agent job as seperate servers

    Hi,
    We would like to do the following,
    SSIS run time engine on Server1
    SQL Agent on Server2
    .Dtsx packages on differnt file system Server3
    Can my Job scheduled on SQL Agnet (Server 2) able to execute the SSIS package located on Server3??
    If So what should be my server capacity for server 1 through 3 -- Standard 64gb, 16 core, 500 GB storage enough??
    Regards,
    Navin
    Navin.D http://dnavin.wordpress.com

    Hi Navin,
    I don’t think it is possible in this situation.
    When you attempt to run a SQL Server Agent Job created on Server2 to execute a package on Server3, the package will load onto and try to run from Server2. Since the local computer does not have Integration Services installed, the packages will not run.
    The SSIS service and SQL Server Agent service should be installed on the same server, and a package can be on a remote server in this case. 
    In your deployment, you can run the package by schedule through bypassing the SQL Server Agent on Server2. There are two approaches:
    Create a batch file to execute DTEXEC command lines on Server1, and then create a Windows Schedule Task to run the batch file.
    Create a console application to call a Web service to run packages on Server2 programmatically, and then use Windows Schedule Task to run the console application.
    References:
    http://technet.microsoft.com/en-us/library/ms403355.aspx
    http://nirav.extreme-advice.com/2013/05/08/schedule-ssis-package-without-deploying/
    Regards,
    Mike Yin
    TechNet Community Support

  • Error while running the package .

    guys,
    i created a transformation file is succesfully completed . when i run the package it is showing the error
    like
    immediate run error while creating to run the package on the server
    <appserverurl>>!cdata(http://localhost/osoft></appserverurl
    Thanks,
    Aj

    Hi,
    It looks like the server is sending the client an HTML file vs. the XML file it is expecting. Can you run a web trace on it like fiddler?
    Cheers, Scott

  • I want to run a package link using a macro code .

    If there is a package RUN_CALC under package group COMPANY1 . Then I use the following macro code to run the package :
    Dim EPM As New FPMXLClient.EPMAddInAutomation
    Sub RUN()
    EPM.DataManagerRunPackage "RUN_CALC", "COMPANY1", ""
    End Sub
    There is another set of calculations that is run through package RUN_CALC2 . Now I  have linked the two packages : RUN_CALC1 and RUN_CALC2.
    Now I not getting any suitable macro code to run this package link . Please suggest the code .
    Thanks,
    SHUBHAM

    Hi Shubham,
    1)     Create Package link.
    2)     Set your prompts.
    3)     Run  your package link using Data Manager-->Run Package-->Run Package link
    To run package link through VBA you need unique name of package ID.
    4)     After running package link go to SE16 select table name UJD_LINK_LOG.
    5)     Then system will generate one entry in table UJD_LINK_LOG.
    6)     Copy Unique ID of that package.
    7)     Use that Package ID in the VBA Code.
    Regards,
    Sushant

  • Get error from SQL AGENT: The SSIS Runtime has failed to enlist the OLE DB connection in a distributed transaction with error 0x8004D024

    I am running SQL Agent that executes an SSIS process from sql server1. The SSIS process executes its SQL/tables/sp’s  against another sql server2.
    I get an error after adding data flow tasks with transaction supported within a sequence with transaction required. The error, “The SSIS Runtime has failed to enlist the OLE DB connection in a distributed transaction with error 0x8004D024 "The transaction
    manager has disabled its support for remote/network transactions"
    Prior to adding this sequence everything was working from sql agent, and there were other sequences with oledb destinations.
    Everything works when running within SSIS Package.
    I see this article on similar issue,
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/0bfa2569-8849-4884-8f68-8edf98a9b4fe/problem-to-execute-a-package-and-tasks-with-a-certain-transactionoption-property-i-need-help?forum=sqlintegrationservices
    “I had similar issue and solved by setting the following on both the machines. Allow Remote Clients, Allow Remote Administration,
    Allow Inbound Clients, Allow Outbound Clients, and TIP are enabled in Component Services/My Computer/Properties/MSDTC/Security Configuration.”
    I don’t want to remove transaction required for the “Remove Duplicates from Staging” sequence.
    Anyone seen this?
    Greg Hanson

    DTC was running on remote computer. The problem was it was no longer accepting transactions from remote servers. This was in SSIS so I had to turn to "Transaction Supported" for all Data Flow Transactions.
    Greg Hanson

  • Some users can't open DTS Packages

    Hi
    I have installed SQL Server 2008R2 on Windows Server 2008R2.  When I installed SQL Server I installed the options that allow the designing/running of DTS Packages.  I am able to open/design/run these packages OK but some of my colleagues are not
    able to open the packages.
    They are set up as domain/sys admins on the Windows/SQL server and log onto that server directly to manage the DTS packages.  When they attempt to open them they get the attached error message.
    Do I need to install something under their user account in order for them to be able to open DTS Packages?
    Many thanks

    Hi flanjman,
    According to your description, you created DTS packages and you are able to run the packages, other users can log on the server, but could not run the packages with the error: execution cannot continue as the language dependent resource file could not be
    loaded.
    According to the error message, sqlsvc.rll file is missing. To workaround the problem, please refer to the following steps:
    Created the "1033" directory under the "Resources" directory.
    Copy all the files ".RLL" (SQLSVC.RLL, SQLGUI.RLL and SEMSFC.RLL) that existed to the "Resources" directory for this newly created directory ("1033").
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu
    If you have any feedback on our support, please click
    here.
    Wendy Fu
    TechNet Community Support

  • Term is not recognized when executing PowerShell Script through SQL Agent using CMDEXEC

    I am trying to simply execute a PowerShell script that is stored in a file on a network drive through SQL Agent as a job. The script is a basic copy from one directory to another.  I have run and successfully executed this from a command prompt outside
    of SQL Agent.  When I execute this through SQL Agent as a Operating System (CmdExec) command I am getting an error that the term is not recognized as the name of a cmdleet, function, script file or operable program. I have executed many different ways
    put found an article to use double quotes in the network path which I have done with no success. 
    I am executing the following command as a job in SQL Agent:
    PowerShell H:\"\PowerShell""\PS_Scripts\"\batchcopyFFLWithProgress.ps1 through SQL Agent job
    I get the following error message:
     04/21/2015 10:01:09,Copy FFL Files,Error,1,NY11266-LTW7E\JPLAPTOPSQL,Copy FFL Files,Copy FFL files,,Executed as user: NT Service\SQLAgent$JPLAPTOPSQL. H:\PowerShell\PS_Scripts\batchcopyFFLWithProgress.ps1 : The term   'H:\PowerShell\PS_Scripts\batchcopyFFLWithProgress.ps1'
    is not recognized as   the name of a cmdlet<c/> function<c/> script file<c/> or operable program. Check the   spelling of the name<c/> or if a path was included<c/> verify that the path is   correct and try again.
     At line:1 char:1  + H:"\PowerShell\PS_Scripts"\batchcopyFFLWithProgress.ps1  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~      + CategoryInfo          : ObjectNotFound:
    (H:\PowerShell\P...ithProgress.p      s1:String) []<c/> CommandNotFoundException      + FullyQualifiedErrorId : CommandNotFoundException.  Process Exit Code 1.  The step failed.,00:00:03,0,0,,,,0
    Content of batchcopyFFLWithProgress.ps1 which has the PowerShell script:
    $source=ls H:\SQLTest\Script\TestData\*.*
    $i=1
    $source| %{
        [int]$percent = $i / $source.count * 100
        Write-Progress -Activity "Copying ... ($percent %)" -status $_ -PercentComplete $percent -verbose
        copy $_.fullName -Destination H:\test -Recurse
        $i++
    I have searched the internet and have not found any resolution to my error.  If someone has experienced this error and found the resolution I would greatly appreciate your help.

    I have change the service account for SQL Agent to be my domain account as I have local admin rights to my laptop.  I stopped and started the services for SQL Agent and than started the job to run which is copying locally to minimize any network drive
    issues.  I am still getting the same error message as it is showing that I am executing the job under my domain account?  Any thoughts what it could be?
    ErrorMsg
    04/23/2015 11:21:06,Copy FFL Files,Error,1,ServerName\InstanceName,Copy FFL Files,Copy FFL files,,Executed as user: Domain\DomainAccount. \\ServerName\Test\PS_Script\batchcopyFFLWithProgress.ps1 : The term '\\ServerName\Test\PS_Script\batchcopyFFLWithProgress.ps1'
    is   not recognized as the name of a cmdlet<c/> function<c/> script file<c/> or operable program. Check the spelling of the name<c/> or if a path was   included<c/> verify that the path is correct and try again.  At
    line:1 char:1  + \\ServerName\Test\PS_Script\batchcopyFFLWithProgress.ps1  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~      + CategoryInfo          : ObjectNotFound: (\\ServerName...ithProgress.ps1:String)
    []<c/> CommandNotFoundException      + FullyQualifiedErrorId : CommandNotFoundException.  Process Exit Code 1.  The step failed.,00:00:02,0,0,,,,0
    Script
    $source=ls "\\ServerName\Test\TestData\*.*"
    $i=1
    $source| %{
        [int]$percent = $i / $source.count * 100
        Write-Progress -Activity "Copying ... ($percent %)" -status $_ -PercentComplete $percent -verbose
        copy $_.fullName -Destination "\\ServerName\Test\test" -Recurse
        $i++

Maybe you are looking for