Server IP : 104.21.14.103 / Your IP : 18.225.56.233 Web Server : LiteSpeed System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : giankuin ( 1871) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/facter/util/windows/ |
Upload File : |
# frozen_string_literal: true require 'win32ole' module Facter module Util module Windows class Win32Ole RPC_C_IMP_LEVEL_IMPERSONATE = 3 def initialize locator = WIN32OLE.new('WbemScripting.SWbemLocator') @conn = locator.ConnectServer('.', 'root\\cimv2') @conn.Security_.ImpersonationLevel = RPC_C_IMP_LEVEL_IMPERSONATE end def return_first(query) result = exec_query(query) return result.to_enum.first if result nil end def exec_query(query) @conn.execquery(query) end end end end end