Signed-off-by: Paul Nasrat <[EMAIL PROTECTED]>
---
 lib/facter/domain.rb |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/lib/facter/domain.rb b/lib/facter/domain.rb
index 724dd1b..57b04f6 100644
--- a/lib/facter/domain.rb
+++ b/lib/facter/domain.rb
@@ -62,3 +62,17 @@ Facter.add(:domain) do
         end
     end
 end
+Facter.add(:domain) do
+    confine :kernel => :windows
+    setcode do
+        require 'win32ole'
+        domain = ""
+        wmi = WIN32OLE.connect("winmgmts://")
+        query = "select DNSDomain from Win32_NetworkAdapterConfiguration where 
IPEnabled = True"
+        wmi.ExecQuery(query).each { |nic| 
+            domain = nic.DNSDomain
+            break 
+        }
+        domain
+    end
+end
-- 
1.5.3.4


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to