Get Agent Type (ProductType) is it a Server or Workstation

Agent Procedure, Script, Audit


This procedure is getting the Type of the Machine(Domain Controller, Server, Workstation or Unknown) from Microsoft ProductType class.
The value can be used to build views, policies our other...

Why: You can easily build views for all Server/ Workstation without to filter static with OS Version.

Requirement: Custom Field 'Operating System Type'

13-08-2020: Fix Import Bug with characters Kaseya doesn't support (Set variable doesn't allow <<>> characters .)

  • Name: Pieter Jorritsma
  • Company: ViaData
  • Website:
  • Contact Developer
  • Summary
  • Get Agent Type (ProductType) is it a Server or Workstation
  • Version: 1.1
  • Initially Released August 4th, 2020
  • Reviews

    Get Agent Type (ProductType) is it a Server or Workstation has no reviews.

    Gravatar for Jake Nichols
    Jake Nichols 6 months ago

    I had to modify the script to give proper outputs
    The default is (wmiobject win32_operatingsystem).ProductType Which is marked every server type including DC as Server. 
    I switch it to 
    (wmiobject win32_computersystem).DomainRole and set the if statements to check for the following:
    0 Standalone Workstation
    1 Member Workstation
    2 Standalone Server
    3 Member Server
    4 Backup Domain Controller
    5 Primary Domain Controller

    Gravatar for Pieter Jorritsma
    Pieter Jorritsma 6 months ago

    Hello Jake,

    Nice to see you change you output for you purpose :)!