Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
Templates Updated README and Sensors; Moved Sensors Templates into the Template… Aug 2, 2019
README.md Added os_browser_default which returns the default web browser set on… Aug 5, 2019
battery_actual_capacity.ps1 Updated battery sensors Oct 9, 2019
battery_charging_status.ps1 Updated battery sensors Oct 9, 2019
battery_designed_capacity.ps1 Updated battery sensors Oct 9, 2019
battery_estimated_charge_remaining.ps1 Updated battery sensors Oct 9, 2019
battery_health_percentage.ps1 Updated battery sensors Oct 9, 2019
bios_secure_boot.ps1 Revert "Revert "Merge branch 'master' of https://github.com/vmwaresam… Apr 29, 2019
bios_serial_number.ps1 updated bios_secure_boot and bios_serial_number Nov 21, 2018
bios_smbios_present.ps1 Changed samples to use write-output instead of echo Nov 15, 2018
bios_smbios_version.ps1 Updated sesnors Jun 24, 2019
bios_status.ps1 Revert "Revert "Merge branch 'master' of https://github.com/vmwaresam… Apr 29, 2019
bitlocker_encryption_method.ps1 added os_verison, os_build_version, os_build_number, os_architecture,… Nov 30, 2018
branchcache_enabled.ps1 Added BranchCache Mode Sensor Aug 6, 2019
branchcache_mode.ps1 Added BranchCache Mode Sensor Aug 6, 2019
branchcache_service_status.ps1 Added BranchCache Mode Sensor Aug 6, 2019
horizon_broker_url.ps1 Update script to handle exception May 22, 2019
horizon_protocol.ps1 Update script to handle exception May 22, 2019
import_sensor_samples.ps1 Added switch parameters for overwriting/updating and deleting Sensors. May 6, 2019
os_architecture.ps1 added template_get_wmi_object, template_get_registry_value Nov 30, 2018
os_browser_default.ps1 Added os_browser_default which returns the default web browser set on… Aug 5, 2019
os_build_number.ps1 added template_get_wmi_object, template_get_registry_value Nov 30, 2018
os_build_version.ps1 added template_get_wmi_object, template_get_registry_value Nov 30, 2018
os_cpu_usage.ps1 Round return value Jul 17, 2019
os_cpu_usage_processname.ps1 Fixed some Sensors, added system_hash_svchost.ps1 and template_get_fo… May 1, 2019
os_edition.ps1 Revert "Revert "Merge branch 'master' of https://github.com/vmwaresam… Apr 29, 2019
os_folder_size_mypictures.ps1 Added file hash and folder size samples and templates. May 2, 2019
os_java_version.ps1 Fixed quotes on Java version sample May 9, 2019
os_memory_physical_usage.ps1 Changed samples to use write-output instead of echo Nov 15, 2018
os_memory_usage_processname.ps1 Round return value Jul 17, 2019
os_memory_virtual_setting.ps1 Create os_memory_virtual_setting.ps1 Aug 25, 2019
os_memory_virtual_usage.ps1 Changed samples to use write-output instead of echo Nov 15, 2018
os_network_interface_name.ps1 Changed samples to use write-output instead of echo Nov 15, 2018
os_network_usage.ps1 Changed samples to use write-output instead of echo Nov 15, 2018
os_network_wifi_present.ps1 Changed samples to use write-output instead of echo Nov 15, 2018
os_network_wifi_ssid.ps1 Updated os_network_wifi_ssid.ps1 to account for null values e.g. not … May 5, 2019
os_power_plan_description.ps1 Revert "Revert "Merge branch 'master' of https://github.com/vmwaresam… Apr 29, 2019
os_power_plan_name.ps1 Revert "Revert "Merge branch 'master' of https://github.com/vmwaresam… Apr 29, 2019
os_powershell_version.ps1 Changed samples to use write-output instead of echo Nov 15, 2018
os_printers.ps1 Create os_printers.ps1 Aug 25, 2019
os_process_running.ps1 Fixed some Sensors, added system_hash_svchost.ps1 and template_get_fo… May 1, 2019
os_releaseID.ps1 Updated sesnors Jun 24, 2019
os_version.ps1 added template_get_wmi_object, template_get_registry_value Nov 30, 2018
software_office_version.ps1 Create software_office_version.ps1 Nov 16, 2019
system_date.ps1 Update date time return to ISO format Jul 17, 2019
system_domain_membership.ps1
system_domain_name.ps1 added system_pc_type, system_status, system_family, system_type, syst… Dec 3, 2018
system_domain_role.ps1 added system_pc_type, system_status, system_family, system_type, syst… Dec 3, 2018
system_family.ps1 added system_pc_type, system_status, system_family, system_type, syst… Dec 3, 2018
system_hash_svchost.ps1 Fixed some Sensors, added system_hash_svchost.ps1 and template_get_fo… May 1, 2019
system_hostname.ps1 Updated sesnors Jun 24, 2019
system_hypervisor_present.ps1
system_manufacturer.ps1 added system_pc_type, system_status, system_family, system_type, syst… Dec 3, 2018
system_model.ps1 added system_pc_type, system_status, system_family, system_type, syst… Dec 3, 2018
system_name.ps1 added system_pc_type, system_status, system_family, system_type, syst… Dec 3, 2018
system_pc_type.ps1 added system_pc_type, system_status, system_family, system_type, syst… Dec 3, 2018
system_rdp_status.ps1 Create system_rdp_status.ps1 Aug 20, 2019
system_status.ps1 Revert "Revert "Merge branch 'master' of https://github.com/vmwaresam… Apr 29, 2019
system_thermal_state.ps1 added system_pc_type, system_status, system_family, system_type, syst… Dec 3, 2018
system_timezone.ps1
system_type.ps1 Revert "Revert "Merge branch 'master' of https://github.com/vmwaresam… Apr 29, 2019
system_username.ps1 Updated README and Sensors; Moved Sensors Templates into the Template… Aug 2, 2019
system_wakeup_type.ps1 added system_pc_type, system_status, system_family, system_type, syst… Dec 3, 2018
tpm_locked_out.ps1 Revert "Revert "Merge branch 'master' of https://github.com/vmwaresam… Apr 29, 2019
tpm_lockout_heal_time.ps1 Revert "Revert "Merge branch 'master' of https://github.com/vmwaresam… Apr 29, 2019
tpm_present.ps1 Revert "Revert "Merge branch 'master' of https://github.com/vmwaresam… Apr 29, 2019
tpm_ready.ps1 Revert "Revert "Merge branch 'master' of https://github.com/vmwaresam… Apr 29, 2019

README.md

Workspace ONE Sensors

Overview

Purpose

These Workspace ONE Sensor samples contain PowerShell command lines or scripts that can be used in a Provisioning > Custom Attributes > Sensors payload to report back information about the Windows 10 device back to Workspace ONE.

Description

There are Sensor samples, templates, and a script import_sensor_samples.ps1 to populate your environment with all of the samples.

Required Changes/Updates

You will want to leverage the template_ samples and modify any of the data, or leverage the existing samples. You can also leverage the import_sensor_samples.ps1 script to upload the samples to your environment. Only the templates and the Sensor Importer require changes. Samples work as is, but can also be modified for your needs.

WMI Query Template

$wmi=(Get-WmiObject WMI_Class_Name)
write-output $wmi.Attribute_Name

Registry Value Template

$reg=Get-ItemProperty "HKLM:\Key Folder\Key Name"
write-output $reg.ValueName

Hash Value Template

$file=Get-FileHash ([Environment]::SystemDirectory + "\filename.exe") -Algorithm MD5
Write-Output $file.Hash

Folder Size Template

$TargetFolder = [Environment]::GetFolderPath("MyPictures")
$FolderInfo = Get-ChildItem $TargetFolder -Recurse -File | Measure-Object -Property Length -Sum
$FolderSize = ($FolderInfo.Sum/1MB)
Write-Output  ([System.Math]::Round($FolderSize))

Workspace ONE Sensors Importer

Synopsis

This Powershell script allows you to automatically import PowerShell scripts (Sensor Samples) as Workspace ONE Sensors in the Workspace ONE UEM Console. MUST RUN AS ADMIN

Description

Place this PowerShell script in the same directory of all of your samples (.ps1 files) or use the -SensorsDirectory parameter to specify your directory. This script when run will parse the PowerShell sample scripts, check if they already exist, then upload to Workspace ONE UEM via the REST API.

Examples

  • Basic: this command shows all required fields and will scan the default directory and upload the samples to Workspace ONE via the REST API using the credentials provided.

      .\import_sensor_samples.ps1 `
      -WorkspaceONEServer "https://as###.awmdm.com" `
      -WorkspaceONEAdmin "administrator" `
      -WorkspaceONEAdminPW "P@ssw0rd" `
      -WorkspaceONEAPIKey "YeJtOTx/v2EpXPIEEhFo1GfAWVCfiF6TzTMKAqhTWHc=" `
      -OrganizationGroupName "techzone"
    
  • Custom Directory: using the -SensorsDirectory parameter tells the script where your samples exist. The directory provided must have .ps1 files which you want uploaded as Sensors.

      .\import_sensor_samples.ps1 `
      -WorkspaceONEServer "https://as###.awmdm.com" `
      -WorkspaceONEAdmin "administrator" `
      -WorkspaceONEAdminPW "P@ssw0rd" `
      -WorkspaceONEAPIKey "YeJtOTx/v2EpXPIEEhFo1GfAWVCfiF6TzTMKAqhTWHc=" `
      -OrganizationGroupName "techzone" `
      -SensorsDirectory "C:\Users\G.P.Burdell\Downloads\Sensors"
    
  • Assign to Smart Group: using the -SmartGroupID parameter will assign ALL Sensors which were uploaded and that already exist to that chosen Smart Group. Existing Smart Group memberships will be overwritten! This command is used best in a test environment to quickly test Sensors before moving Sensors to production. Obtain the Smart Group ID via API or by hovering over the Smart Group name in the console and looking at the ID at the end of the URL.

      .\import_sensor_samples.ps1 `
      -WorkspaceONEServer "https://as###.awmdm.com" `
      -WorkspaceONEAdmin "administrator" `
      -WorkspaceONEAdminPW "P@ssw0rd" `
      -WorkspaceONEAPIKey "YeJtOTx/v2EpXPIEEhFo1GfAWVCfiF6TzTMKAqhTWHc=" `
      -OrganizationGroupName "techzone" `
      -SmartGroupID "14"
    
  • Delete All Sensors: using the -DeleteSensors switch parameter will delete ALL Sensors which were uploaded and that already exist to that chosen Organization Group. All Sensors will be deleted, including the Sensors which were manually added!

      .\import_sensor_samples.ps1 `
      -WorkspaceONEServer "https://as###.awmdm.com" `
      -WorkspaceONEAdmin "administrator" `
      -WorkspaceONEAdminPW "P@ssw0rd" `
      -WorkspaceONEAPIKey "YeJtOTx/v2EpXPIEEhFo1GfAWVCfiF6TzTMKAqhTWHc=" `
      -OrganizationGroupName "techzone" `
      -DeleteSensors
    
  • Update Sensors or Overwrite Existing Sensors: using the -UpdateSensors switch parameter will update ALL Sensors that already exist which the version in the PowerShell samples. This is best used when updates and fixes are published to the source PowerShell samples.

      .\import_sensor_samples.ps1 `
      -WorkspaceONEServer "https://as###.awmdm.com" `
      -WorkspaceONEAdmin "administrator" `
      -WorkspaceONEAdminPW "P@ssw0rd" `
      -WorkspaceONEAPIKey "YeJtOTx/v2EpXPIEEhFo1GfAWVCfiF6TzTMKAqhTWHc=" `
      -OrganizationGroupName "techzone" `
      -UpdateSensors
    

Parameters

WorkspaceONEServer: Server URL for the Workspace ONE UEM API Server e.g. https://as###.awmdm.com without the ending /API. Navigate to All Settings -> System -> Advanced -> API -> REST API.

WorkspaceONEAdmin: An Workspace ONE UEM admin account in the tenant that is being queried. This admin must have the API role at a minimum.

WorkspaceONEAdminPW: The password that is used by the admin specified in the admin parameter

WorkspaceONEAPIKey: This is the REST API key that is generated in the Workspace ONE UEM Console. You locate this key at All Settings -> System -> Advanced -> API -> REST API, and you will find the key in the API Key field. If it is not there you may need override the settings and Enable API Access.

OrganizationGroupName: The Group ID of the Organization Group. You can find this by hovering over your Organization's Name in the console.

SensorsDirectory: (OPTIONAL) The directory your .ps1 sensors samples are located, default location is the current PowerShell directory of this script.

SmartGroupID: (OPTIONAL) If provided, all sensors in your environment will be assigned to this Smart Group. Existing assignments will be overwritten. Navigate to Groups & Settings > Groups > Assignment Groups. Hover over the Smart Group, then look for the number at the end of the URL, this is your Smart Group ID.

DeleteSensors: (OPTIONAL) If enabled, all sensors in your environment will be deleted. This action cannot be undone. Ensure you are targeting the correct Organization Group.

UpdateSensors (OPTIONAL) If enabled, all sensors that match will be updated with the version in the PowerShell samples.

Change Log

  • 8/5/2019 - Added os_browser_default which returns the default web browser set on the device. Thank you for the contribution Roar Myklebust.
  • 8/2/2019 - Updated samples, updated README.md, moved template_ samples into a folder named Templates.
  • 5/9/2019 - Added branch cache samples and fixed java version sample
  • 5/6/2019 - Added battery health percentage
  • 5/6/2019 - Added switch parameters for overwriting/updating and deleting Sensors.
  • 5/2/2019 - Added Hash, Folder Size samples and templates
  • 4/26/2019 - Force use of TLS 1.2 for REST API Calls; fixed minor issues
  • 12/6/2018 - Added more details on how to use import_sensor_samples.ps1
  • 12/5/2018 - Added import_sensor_samples.ps1 and updated system_type, system_status, system_date, templates, system_family
  • 12/3/2018 - added system_pc_type, system_status, system_family, system_type, system_thermal_state, system_wakeup_type, system_model, system_manufacturer, system_hypervisor_present, system_dns_hostname, system_username, system_name, system_domain_role, system_domain_membership, system_domain_name
  • 11/30/2018 - added os_verison, os_build_version, os_build_number, os_architecture, os_edition, system_timezone, bitlocker_encryption_method, horizon_broker_url, horizon_protocol, template_get_wmi_object, template_get_registry_value
  • 11/21/2018 - updated bios_secure_boot and bios_serial_number
  • 11/15/2018 - changed echo to write-output in all samples
  • 11/14/2018 - Uploaded README file

Additional Resources

Coming Soon on techzone.vmware.com!

You can’t perform that action at this time.