Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

MBS FileMaker Plugin Example Databases

WMI Query

All examples are included with download of MBS FileMaker Plugin.

WMI Query.fmp12

Overview
Tables 2
Relationships 1
Layouts 3
Scripts 2
Value Lists 0
Custom Functions 0
Custom Menus 24
File Options
Default custom menu set [Standard FileMaker Menus]
Default theme Kühl grau
When opening file
Minimum allowed version 12.0
Login using Account Name; Account= Admin
Allow user to save password On
Require iOS passcode Off
Show Sign-in fields Off
Switch to layout Off
Hide all toolbars Off
Script triggers
OnFirstWindowOpen Off
OnLastWindowClose Off
OnWindowOpen Off
OnWindowClose Off
OnFileAVPlayerChange Off
OnWindowTransaction Off
Thumbnail Settings
Generate Thumbnails On; Temporary

 

Tables

Table Name
Statistics
Comments
Occurrences in Relationship Graph
WMI Query
8 fields defined, 13 records
WMI Query
Result
4 fields defined, 0 record
Result

Fields

Table Name: WMI Query - 8 Fields
Field Name Type Options Comments On Layouts In Relationships In Scripts In Value Lists
NetworkResource Normal, Text Auto-Enter:
  • Constant data: root\cimv2
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Repetitions: 1
  • Indexing: None
  • Automatically create indexes as needed
  • Index Language: German
      User Normal, Text Auto-Enter:
      • Allow editing
      Validation:
      • Only during data entry
      Storage:
      • Repetitions: 1
      • Indexing: None
      • Automatically create indexes as needed
      • Index Language: German
          Password Normal, Text Auto-Enter:
          • Allow editing
          Validation:
          • Only during data entry
          Storage:
          • Repetitions: 1
          • Indexing: None
          • Automatically create indexes as needed
          • Index Language: German
              Locale Normal, Text Auto-Enter:
              • Allow editing
              Validation:
              • Only during data entry
              Storage:
              • Repetitions: 1
              • Indexing: None
              • Automatically create indexes as needed
              • Index Language: German
                  Authority Normal, Text Auto-Enter:
                  • Allow editing
                  Validation:
                  • Only during data entry
                  Storage:
                  • Repetitions: 1
                  • Indexing: None
                  • Automatically create indexes as needed
                  • Index Language: German
                      Query Normal, Text Auto-Enter:
                      • Allow editing
                      Validation:
                      • Only during data entry
                      Storage:
                      • Repetitions: 1
                      • Indexing: None
                      • Automatically create indexes as needed
                      • Index Language: German
                          QueryID Normal, Text Auto-Enter:
                          • Allow editing
                          Validation:
                          • Only during data entry
                          Storage:
                          • Repetitions: 1
                          • Indexing: Minimal
                          • Automatically create indexes as needed
                          • Index Language: German
                              JSON Normal, Text Auto-Enter:
                              • Allow editing
                              Validation:
                              • Only during data entry
                              Storage:
                              • Repetitions: 1
                              • Indexing: None
                              • Automatically create indexes as needed
                              • Index Language: German

                                  Table Name: Result - 4 Fields
                                  Field Name Type Options Comments On Layouts In Relationships In Scripts In Value Lists
                                  Name Normal, Text Auto-Enter:
                                  • Allow editing
                                  Validation:
                                  • Only during data entry
                                  Storage:
                                  • Repetitions: 1
                                  • Indexing: None
                                  • Automatically create indexes as needed
                                  • Index Language: German
                                      Type Normal, Text Auto-Enter:
                                      • Allow editing
                                      Validation:
                                      • Only during data entry
                                      Storage:
                                      • Repetitions: 1
                                      • Indexing: None
                                      • Automatically create indexes as needed
                                      • Index Language: German
                                          Text Normal, Text Auto-Enter:
                                          • Allow editing
                                          Validation:
                                          • Only during data entry
                                          Storage:
                                          • Repetitions: 1
                                          • Indexing: None
                                          • Automatically create indexes as needed
                                          • Index Language: German
                                              QueryID Normal, Text Auto-Enter:
                                              • Allow editing
                                              Validation:
                                              • Only during data entry
                                              Storage:
                                              • Repetitions: 1
                                              • Indexing: Minimal
                                              • Automatically create indexes as needed
                                              • Index Language: German

                                                  Layout Objects: WMI Query

                                                  Regular Fields

                                                  Field Name: WMI Query::NetworkResource
                                                  Field Properties Coordinates Field Format Field Behavior Quick Find
                                                  • Top: 36 pt
                                                  • Left: 138 pt
                                                  • Bottom: 58 pt
                                                  • Right: 391 pt
                                                  • Anchoring: Left, Top
                                                  Field Format:
                                                  • Edit Box
                                                  Field Behavior:
                                                  • Allow field to be entered: In Find mode, In Browse mode
                                                  • Touch keyboard type: System Default
                                                  • Go to next field using: Tab key
                                                  Yes

                                                  Field Name: WMI Query::User
                                                  Field Properties Coordinates Field Format Field Behavior Quick Find
                                                  • Top: 60 pt
                                                  • Left: 138 pt
                                                  • Bottom: 82 pt
                                                  • Right: 391 pt
                                                  • Anchoring: Left, Top
                                                  Field Format:
                                                  • Edit Box
                                                  Field Behavior:
                                                  • Allow field to be entered: In Find mode, In Browse mode
                                                  • Touch keyboard type: System Default
                                                  • Go to next field using: Tab key
                                                  Yes

                                                  Field Name: WMI Query::Password
                                                  Field Properties Coordinates Field Format Field Behavior Quick Find
                                                  • Top: 84 pt
                                                  • Left: 138 pt
                                                  • Bottom: 106 pt
                                                  • Right: 391 pt
                                                  • Anchoring: Left, Top
                                                  Field Format:
                                                  • Edit Box
                                                  Field Behavior:
                                                  • Allow field to be entered: In Find mode, In Browse mode
                                                  • Touch keyboard type: System Default
                                                  • Go to next field using: Tab key
                                                  Yes

                                                  Field Name: WMI Query::Locale
                                                  Field Properties Coordinates Field Format Field Behavior Quick Find
                                                  • Top: 108 pt
                                                  • Left: 138 pt
                                                  • Bottom: 130 pt
                                                  • Right: 391 pt
                                                  • Anchoring: Left, Top
                                                  Field Format:
                                                  • Edit Box
                                                  Field Behavior:
                                                  • Allow field to be entered: In Find mode, In Browse mode
                                                  • Touch keyboard type: System Default
                                                  • Go to next field using: Tab key
                                                  Yes

                                                  Field Name: WMI Query::Authority
                                                  Field Properties Coordinates Field Format Field Behavior Quick Find
                                                  • Top: 132 pt
                                                  • Left: 138 pt
                                                  • Bottom: 154 pt
                                                  • Right: 391 pt
                                                  • Anchoring: Left, Top
                                                  Field Format:
                                                  • Edit Box
                                                  Field Behavior:
                                                  • Allow field to be entered: In Find mode, In Browse mode
                                                  • Touch keyboard type: System Default
                                                  • Go to next field using: Tab key
                                                  Yes

                                                  Field Name: WMI Query::Query
                                                  Field Properties Coordinates Field Format Field Behavior Quick Find
                                                  • Top: 199 pt
                                                  • Left: 138 pt
                                                  • Bottom: 242 pt
                                                  • Right: 391 pt
                                                  • Anchoring: Left and Right, Top
                                                  Field Format:
                                                  • Edit Box
                                                  Field Behavior:
                                                  • Allow field to be entered: In Find mode, In Browse mode
                                                  • Touch keyboard type: System Default
                                                  • Go to next field using: Tab key
                                                  Yes

                                                  Field Name: WMI Query::JSON
                                                  Field Properties Coordinates Field Format Field Behavior Quick Find
                                                  • Top: 266 pt
                                                  • Left: 138 pt
                                                  • Bottom: 415 pt
                                                  • Right: 391 pt
                                                  • Anchoring: Left and Right, Top
                                                  Field Format:
                                                  • Edit Box
                                                  Field Behavior:
                                                  • Allow field to be entered: In Find mode, In Browse mode
                                                  • Touch keyboard type: Default for Data Type
                                                  • Go to next field using: Tab key
                                                  Yes

                                                  Buttons

                                                  Button Properties Coordinates Script/Script Step
                                                    Type:
                                                  • Text: Query
                                                  • Top: 201 pt
                                                  • Left: 424 pt
                                                  • Bottom: 233 pt
                                                  • Right: 526 pt
                                                  • Anchoring: Right, Top
                                                  Perform Script [ “Query” ]

                                                  Scripts:


                                                  Button Properties Coordinates Script/Script Step
                                                    Type:
                                                  • Text: Query JSON
                                                  • Top: 266 pt
                                                  • Left: 424 pt
                                                  • Bottom: 298 pt
                                                  • Right: 526 pt
                                                  • Anchoring: Right, Top
                                                  Perform Script [ “Query JSON” ]

                                                  Scripts:


                                                  Layout Objects: Result

                                                  Regular Fields

                                                  Field Name: Result::Name
                                                  Field Properties Coordinates Field Format Field Behavior Quick Find
                                                  • Top: 70 pt
                                                  • Left: 5 pt
                                                  • Bottom: 92 pt
                                                  • Right: 213 pt
                                                  • Anchoring: Left, Top
                                                  Field Format:
                                                  • Edit Box
                                                  Field Behavior:
                                                  • Allow field to be entered: In Find mode, In Browse mode
                                                  • Touch keyboard type: System Default
                                                  • Go to next field using: Tab key
                                                  Yes

                                                  Field Name: Result::Type
                                                  Field Properties Coordinates Field Format Field Behavior Quick Find
                                                  • Top: 70 pt
                                                  • Left: 220 pt
                                                  • Bottom: 92 pt
                                                  • Right: 311 pt
                                                  • Anchoring: Left, Top
                                                  Field Format:
                                                  • Edit Box
                                                  Field Behavior:
                                                  • Allow field to be entered: In Find mode, In Browse mode
                                                  • Touch keyboard type: System Default
                                                  • Go to next field using: Tab key
                                                  Yes

                                                  Field Name: Result::Text
                                                  Field Properties Coordinates Field Format Field Behavior Quick Find
                                                  • Top: 70 pt
                                                  • Left: 318 pt
                                                  • Bottom: 92 pt
                                                  • Right: 571 pt
                                                  • Anchoring: Left, Top
                                                  Field Format:
                                                  • Edit Box
                                                  Field Behavior:
                                                  • Allow field to be entered: In Find mode, In Browse mode
                                                  • Touch keyboard type: System Default
                                                  • Go to next field using: Tab key
                                                  Yes

                                                  Buttons

                                                  Button Properties Coordinates Script/Script Step
                                                    Type:
                                                  • Text: Go Back
                                                  • Top: 6 pt
                                                  • Left: 14 pt
                                                  • Bottom: 28 pt
                                                  • Right: 115 pt
                                                  • Anchoring: Left, Top
                                                  Go to Layout [ “WMI Query” (WMI Query) ]

                                                  Layouts:


                                                  Script Hierarchy

                                                  Query
                                                  Query JSON

                                                  Next Script: [Query JSON]
                                                  Script Name Query
                                                  Run script with full access privileges Off
                                                  Siri Shortcut Visible Off
                                                  Include In Menu Yes
                                                  Layouts that use this script
                                                  Scripts that use this script
                                                    Script Definition
                                                    Script Steps
                                                    • Set Variable [ $q; Value:MBS("WMIQuery.New") ]
                                                    • If [ MBS("IsError") = 0 ]
                                                    • Set Field [ WMI Query::QueryID; $q ]
                                                    • #connect to server
                                                    • Set Variable [ $r; Value:MBS("WMIQuery.Connect"; $q; WMI Query::NetworkResource; WMI Query::User; WMI Query::Password; WMI Query::Locale; WMI Query::Authority) ]
                                                    • If [ MBS("IsError") = 0 ]
                                                    • #run query
                                                    • Set Variable [ $r; Value:MBS("WMIQuery.Query"; $q; WMI Query::Query) ]
                                                    • If [ MBS("IsError") = 0 ]
                                                    • #show result
                                                    • Go to Related Record [ From table: “Result”; Using layout: “Result” (Result) ] [ Show only related records ]
                                                    • Go to Layout [ “Result” (Result) ]
                                                    • Delete All Records [ No dialog ]
                                                    • Loop [ Flush: Always ]
                                                    • Set Variable [ $r; Value:MBS("WMIQuery.Next"; $q) ]
                                                    • Exit Loop If [ $r ≠ "OK" ]
                                                    • #show properties
                                                    • Set Variable [ $Names; Value:MBS("WMIQuery.PropertyNames"; $q) ]
                                                    • If [ MBS("IsError") ]
                                                    • Show Custom Dialog [ Title: "Query Error"; Message: $r; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                    • Exit Script [ ]
                                                    • Else [ ]
                                                    • #loop properties
                                                    • Set Variable [ $count; Value:ValueCount ( $Names ) ]
                                                    • Set Variable [ $index; Value:1 ]
                                                    • Loop [ Flush: Always ]
                                                    • #property name, type and value
                                                    • Set Variable [ $name; Value:GetValue($Names; $index) ]
                                                    • Set Variable [ $type; Value:MBS("WMIQuery.PropertyType"; $q; $name) ]
                                                    • Set Variable [ $value; Value:MBS("WMIQuery.PropertyValue"; $q; $name) ]
                                                    • New Record/Request
                                                    • Set Field [ Result::Name; $name ]
                                                    • Set Field [ Result::Type; $type ]
                                                    • Set Field [ Result::Text; $value ]
                                                    • Set Field [ Result::QueryID; $q ]
                                                    • Commit Records/Requests [ No dialog ]
                                                    • #next
                                                    • Set Variable [ $index; Value:$index +1 ]
                                                    • Exit Loop If [ $index > $count ]
                                                    • End Loop
                                                    • End If
                                                    • End Loop
                                                    • Else [ ]
                                                    • Show Custom Dialog [ Title: "Query Error"; Message: $r; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                    • End If
                                                    • Else [ ]
                                                    • Show Custom Dialog [ Title: "Connect Error"; Message: $r; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                    • End If
                                                    • #cleanup
                                                    • Set Variable [ $r; Value:MBS("WMIQuery.Release"; $q) ]
                                                    • End If
                                                    Fields used in this script
                                                    Scripts used in this script
                                                      Layouts used in this script
                                                      Tables used in this script
                                                      Table occurrences used by this script
                                                      Custom Functions used by this script
                                                        Custom menu set used by this script

                                                          Previous Script: [Query]
                                                          Script Name Query JSON
                                                          Run script with full access privileges Off
                                                          Siri Shortcut Visible Off
                                                          Include In Menu Yes
                                                          Layouts that use this script
                                                          Scripts that use this script
                                                            Script Definition
                                                            Script Steps
                                                            • Set Variable [ $q; Value:MBS("WMIQuery.New") ]
                                                            • If [ MBS("IsError") = 0 ]
                                                            • Set Field [ WMI Query::QueryID; $q ]
                                                            • #connect to server
                                                            • Set Variable [ $r; Value:MBS("WMIQuery.Connect"; $q; WMI Query::NetworkResource; WMI Query::User; WMI Query::Password; WMI Query::Locale; WMI Query::Authority) ]
                                                            • If [ MBS("IsError") = 0 ]
                                                            • #run query
                                                            • Set Variable [ $r; Value:MBS("WMIQuery.Query"; $q; WMI Query::Query) ]
                                                            • If [ MBS("IsError") = 0 ]
                                                            • #show result
                                                            • Set Variable [ $r; Value:MBS("WMIQuery.JSON"; $q) ]
                                                            • Set Variable [ $r; Value:MBS("JSON.Colorize"; $r) ]
                                                            • Set Field [ WMI Query::JSON; $r ]
                                                            • End If
                                                            • Else [ ]
                                                            • Show Custom Dialog [ Title: "Connect Error"; Message: $r; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                            • End If
                                                            • #cleanup
                                                            • Set Variable [ $r; Value:MBS("WMIQuery.Release"; $q) ]
                                                            • End If
                                                            Fields used in this script
                                                            Scripts used in this script
                                                              Layouts used in this script
                                                                Tables used in this script
                                                                Table occurrences used by this script
                                                                Custom Functions used by this script
                                                                  Custom menu set used by this script

                                                                    Download example: WMI Query

                                                                    Used functions: