Topic
3 replies Latest Post - ‏2013-08-29T08:10:45Z by ToshikiMatsui
TJessee
TJessee
17 Posts
ACCEPTED ANSWER

Pinned topic Upload a file to TEM from an Endpoint

‏2013-08-28T15:27:44Z |

I have an action script that I am going to run that will ulitmately populate a file on a given endpoint.  I then want to copy that file that I created from the Endpoint to a specific folder on the TEM server.

Any help is greatly appreciated.

 

Troy

  • BigFixNinja
    BigFixNinja
    2 Posts
    ACCEPTED ANSWER

    Re: Upload a file to TEM from an Endpoint

    ‏2013-08-28T15:38:07Z  in response to TJessee

    Here is an article for how to do something similar involving a .reg file (same concepts appy)

    How to create a registry entry on-the-fly using appendfile or createfile. Using the following instructions you will use basic appendfile or createfile commands to create, modify, or delete registry entries on TEM endpoints.

    1. Create a filename.reg file using notepad.

    2. Using Notepad and the following template create the registry values in the .reg format:

    Syntax Template:

    RegistryEditorVersion

    Blank line

    [RegistryPath1]

    "DataItemName1"="DataType1:DataValue1"

    DataItemName2"="DataType2:DataValue2"

    Blank line

    [RegistryPath2]

    "DataItemName3"="DataType3:DataValue3"

    Example:

    Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TmFilter\Parameters]

    "DebugLogFlags"=dword:00000000

    *See the following for additional details from Microsoft:

    http://support.microsoft.com/kb/310516

    3. Save the file as a registry file (filename.reg ). Execute this registry entry on a test machine. Do not proceed until the registry file is correct and applies appropriately.

    4. Create the file using actionscript:

     

    Createfile

    Line1: delete __createfile <<Always delete __createfile prior to execution.

    Line2: createfile until __END <<Text between createfile and _END

    Line3: copy first line of registry (*.reg) <<Registry Editor Version

    Line4: Copy second line of registry (*.reg) <<Blank Line

    Line5: Copy third line of registry (*.reg) <<Registry key name

    Line6: Copy forth line of registry (*.reg) <<Registry data values

    Line7: __END <<end of createfile

    Line8: blank line

    Line9: delete tmfilter.reg <<Delete the file we are about to create for cleanup.

    Line10: move __createfile tmfilter.reg <<The move command referencing createfile will create the file. This is also an opportunity to create the file in another directory.

    Line11: waithidden regedit /s tmfilter.reg <<Silently executes registry file using regedit.

     

    Createfile Example:

    delete __createfile

    createfile until __END

    Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TmFilter\Parameters]

    "DebugLogFlags"=dword:0

    __END

    delete tmfilter.reg

    move __createfile tmfilter.reg

    waithidden regedit /s tmfilter.reg

     

    Appendfile

    Line1: delete __appendfile <<Always delete __appendfile prior to execution.

    Line2: appendfile 'copy first line of registry (*.reg) <<Registry Editor Version'

    Line3: appendfile 'Copy second line of registry (*.reg) <<Blank Line'

    Line4: appendfile 'Copy second line of registry (*.reg) <<Blank Line'

    Line5: appendfile 'Copy third line of registry (*.reg) <<Registry key name'

    Line6: appendfile 'Copy forth line of registry (*.reg) <<Registry data values'

    Line7: blank line

    Line8: delete tmfilter.reg <<delete the file we are about to create for cleanup

    Line9: move __appendfile tmfilter.reg <<The move command referencing createfile will create the file. This is also an opportunity to create the file in another directory.

    Line10: waithidden regedit /s tmfilter.reg <<silently executes registry file using regedit

     

    Appendfile Example:

    delete _appendfile

    appendfile Windows Registry Editor Version 5.00

    appendfile

    appendfile [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TmFilter\Parameters]

    appendfile "DebugLogFlags"=dword:0

    delete tmfilter.reg

    move __appendfile tmfilter.reg

    waithidden regedit /s tmfilter.reg

    5. Copy and test your actionscript via Custom Action on the test endpoint.

    6. Decide whether this should be a Task for simple execution or a Fixlet if you plan on more advanced applicability and post-success criteria parameters.

  • martinc
    martinc
    47 Posts
    ACCEPTED ANSWER

    Re: Upload a file to TEM from an Endpoint

    ‏2013-08-28T15:55:26Z  in response to TJessee

    Hi Troy,

    The first part of creating a file is pretty simple. The second part of uploading involves a few more steps. For all information, check out http://support.bigfix.com/product/documents/Upload_Archive_Manager_80_101211.pdf as this covers all the syntax.

    I have done this in the past and it does work fairly well. The only issue I had is the location that the file is uploaded to a "random" folder in the "BES Server\UploadManagerData\BufferDir\sha1". This location is explained in the PDF on page 4.

     

    As an example for a zip file that I would upload

    Start the fixlet with the following:

    setting "_BESClient_ArchiveManager_OperatingMode"="2" on "{now}" for client
    setting "_BESClient_ArchiveManager_FileSet-zip"="C:\temp\file.zip" on "{now}" for client
    setting "_BESClient_ArchiveManager_SendAll"="1" on "{now}" for client
    setting "_BESClient_ArchiveManager_MaxArchiveSize"="100000000" on "{now}" for client
     

    Then I would run a script that generated some files and at the end, zipped the files into the one zip file. The last step in the action script is:

    archive now

     

    Hope that helps.

    Martin Carnegie
    Gulf Breeze Software Partners
    www.gulfsoft.com