Kaseya Community

Write FreeDiskSpace to a file?

  • Hi there,

    i'm trying to write the FreeDisk-Space of c:, d: and maybe e: to a file.
    In the documentation, i found the SQLView-Request: vBaseDiskInfo, but everytime i try to get the freedisk, i get the FreeDisk of Drive A:

    If i try to use #vBaseDiskInfo.FreeDisk1# or #vBaseDiskInfo1.FreeDisk#, i still get the info's from Drive A:

    what's wrong?

  • Hi Neovanmatix,

    This was discussed quite a lot on the old forum to no avail,

    Most people had to build their own with VBS or Powershell,

    from a command prompt: wmic logicaldisk get caption,filesystem,freespace

    Is a pretty rough way of getting it, then pipe the results to a file and capture with a "get variable, file content" step.

    To get a formatted output with bytes, gigabytes required going to a proper script file.

    Regards,

    Ryan

  • Arg, fail -.-

    Okay, now i have a second nice problem: I can't read filecontents with more than 1 row into a kaseya-variable?!

    Created two files: test1.txt and test2.txt:

    test1.txt:

    this is one test-row

    test2.txt

    the first test-row

    the second test-row

    the third test-row

    If i try to Get Variable, File Content -> read in test2.txt and write the variable as output into an third file, kaseya writes nothing to it.

    I there any .. trick or something like that?

  • Hi neovanmatix,

    I have been having the same issue and it seems to happen if the output has a return character in it. if i get the contents and then output to script log it just gives me funny ascii chars.

    This might be one we need to lodge a ticket with kaseya about but let me know if there are any solutions.

  • I'm interested as well.

  • Lingario,

    If you are using Powershell to output to a file, and are also experiencing "funny characters" in the Kaseya procedure log, then I think your issue may be ANSI vs Unicode encoding. Powershell will write text output in unicode by default, and I have found that Kaseya does not work correctly with it. To see if this is your problem, open up the text file that you have used to output your Powershell data in Notepad. Go File > Save As and see if the encoding is listed as unicode. If so, you can fix your problem by appending "-encoding ascii" to your Powershell out-file command. This will allow the Kaseya "Get File Content" step to read the file correctly, and it should then display correctly in the procedure log. (And more importantly, your Kaseya "check variable" commands will stop failing)

  • Hi dschoene,

    Thank you for that you are 100% correct. Emails are coming through now with all the characters. Just need to work on th formating.