in chef/cookbooks/uber_helpers/libraries/active_directory.rb [46:67]
def active_directory_state
status = nil
if macos?
cmd = shell_out('/usr/sbin/dsconfigad -show -xml').stdout
elsif windows?
powershell_cmd = '(Get-WmiObject -Class Win32_ComputerSystem).PartOfDomain'
cmd = powershell_out(powershell_cmd).stdout
end
if cmd.nil? || cmd.empty?
return status
elsif macos?
status = Plist.parse_xml(cmd)
elsif windows?
status = Chef::JSONCompat.parse(cmd.chomp.downcase)
end
status
end