Kaseya Community

getting MachineID

  • Hi.

    I am trying to export the registry of all workstations and store it into a network drive. In the drive, i wanted to organize it by Machine ID. My problem is i cant get the machine ID part alone without getting the group. i.e. mac123.root.group.something. Can anyone show me how to get mac123 alone? I tried using get variable > machineID.groupid and i am hoping to get the first part only without resorting to a script. I can easily take what it need in a vbscript but if there's a way to it in kaseya, i would like that. thanks.

    andrew

  • Hi Andrew,  is your agentname forced te be equal to the computer name? if so you can just grab the name from the register and put it into a variable.

    it should be in this regkey

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\ComputerName\ComputerName

  • You would use the SQL View Data (in getvariable) of vmachine/machname..  See below:

     

    <?xml version="1.0" encoding="utf-8"?>

    <ScriptExport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.kaseya.com/vsa/2008/12/Scripting">

      <Procedure name="Get machine name" treePres="3">

        <Body description="">

          <Statement description="Create a named procedure variable and assign a value retrieved from the managed machine by the agent." name="GetVariable" continueOnFail="false">

            <Parameter xsi:type="EnumParameter" name="VariableType" value="SQLView" />

            <Parameter xsi:type="StringParameter" name="SourceContent" value="vmachine/machname" />

            <Parameter xsi:type="StringParameter" name="VariableName" value="name" />

          </Statement>

          </Body>

      </Procedure>

    </ScriptExport>

     

     

  • it was actually right in front of me. Thanks for the responses. i used the echo command - echo %computername% > file.txt. Sorry for the troubles.

  • If you use this Kaseya variable it will be heaps easier :)

    #vMachine.machName#

  • HardKnox - Sorry, i'm sure this very late but i wasnt getting email alerts on this topic anymore. How do you get that variable? Can you give a brief steps to accomplish it? if its not much of a hassle. :) thanks.

  • They are Kaseya Agent variables, if you look in the Kaseya help file you'll find them, here is the link for this one;

    help.kaseya.com/.../2679.htm

    There are many other, the most popular one is the Agent Temp Dir (aka kworking) #vAgentConfiguration.AgentTempDir#

    I was happy and annoyed when I first learned about these cause they never tought us these at the boot camp and these Kaseya Agent variables would have saved me so much time.

    If you want a full list have a look at this link;

    help.kaseya.com/.../2701.htm



    [edited by: HardKnoX at 1:57 PM (GMT -7) on 9-22-2010]
  • Thanks so much. Its funny because i have to write vbscripts just to get these info when its already built-in.. Sigh.. Now i know. Props to you and for me not searching with in Kaseya.. :)

  • HardKnoX Said:

      "They are Kaseya Agent variables, if you look in the Kaseya help file you'll find them, here is the link for    this one;

    help.kaseya.com/.../2679.htm

    There are many other, the most popular one is the Agent Temp Dir (aka kworking) #vAgentConfiguration.AgentTempDir#

    I was happy and annoyed when I first learned about these cause they never tought us these at the boot camp and these Kaseya Agent variables would have saved me so much time.

    If you want a full list have a look at this link;

    help.kaseya.com/.../2701.htm"

    @HardKnoX

    Wow, so you can use any of the #view.columns# as variables? That's huge!  

    How does it react if there are multiple rows returned?  Are they CRLF row delimited?



    [edited by: cashmanifesto at 8:01 AM (GMT -7) on 9-23-2010]
  • dunno, I have only recently found out about them and look for and use them as I need them, I currently use the following ones the most;

    Agent Temp Dir       #vAgentConfiguration.AgentTempDir#

    Agent GUID            #vAgentConfiguration.agentGuid#

    IP Address             #vMachine.IpAddress#

    Machine Name       #vMachine.machName#

    I'm sure I will find uses for some of the rest...

  • HardKnoX

    dunno, I have only recently found out about them and look for and use them as I need them, I currently use the following ones the most;

    Agent Temp Dir       #vAgentConfiguration.AgentTempDir#

    Agent GUID            #vAgentConfiguration.agentGuid#

    IP Address             #vMachine.IpAddress#

    Machine Name       #vMachine.machName#

    I'm sure I will find uses for some of the rest...

    mind - blown.

    very very nice information.  if i run across any that don't work, i'll post about it.  silence assumes success.  i already see 4 or 5 that will help me eliminate healthy chunks of code.