• many apologies, i hadnt seen your two posts before mine.

    I downloaded the files and copied them to the server - i didnt spot that the article was different. I have them as

    Write-SmoCsvToDb.ps1

    $CsvDir = "$ScriptRoot\output\" #"$scriptRoot\Data\"

    $arcDir = "$scriptRoot\Output\Archive\"#"$scriptRoot\Data\Archive\"

    Write-SmoToCsvFile.ps1

    $dir = "$scriptRoot\output\"#"$scriptRoot\Data\"

    The logging actions from these files work - thats to say the .log (.err in the original files) iscreated and then collected up and deposited in the data/archive/...date... folder. Its whole contents are:

    2008-10-09 15:11 processCsv Login

    2008-10-09 15:11 processCsv ServerPermission

    2008-10-09 15:11 processCsv ServerRole

    2008-10-09 15:11 processCsv SqlLinkedServerLogin

    2008-10-09 15:11 processCsv SqlUser

    2008-10-09 15:11 processCsv DatabasePermission

    2008-10-09 15:11 processCsv ObjectPermssion

    2008-10-09 15:11 processCsv DatabaseRole

    2008-10-09 15:11 archiveCsv C:\SQLPSX\output\20081009

    the log files created by the SQL Job steps get created in a different folder (same level as Archive).

    SQLPSX_SMOtoCSV.log is empty

    SQLPSX_CSVtoDB.log contains

    Directory: Microsoft.PowerShell.Core\FileSystem::C:\SQLPSX\Output\Archive

    Mode LastWriteTime Length Name

    ---- ------------- ------ ----

    d---- 09/10/2008 15:11 20081009

    Setting the directory C:\SQLPSX\Output\Archive\20081009\ to compress new files [OK]

    Compressing files in C:\SQLPSX\Output\Archive\20081009

    smocsvtodb.log 398 : 398 = 1.0 to 1 [OK]

    2 files within 2 directories were compressed.

    398 total bytes of data are stored in 398 bytes.

    The compression ratio is 1.0 to 1.

    The SQL job reports success on all steps now - The history for step 2 (Run-SmoToCsvFile) shows

    Message

    Executed as user: . The step did not generate any output. Process Exit Code 0. The step succeeded.

    I would have expected the output of the script creating the csv files running into this message. At least in part if not in full.

    Sorry I cant say it's all working yet...