[Samba] Remote Windows registry read access from Linux?

flinchlock fst6x7v02 at sneakemail.com
Thu Feb 26 12:53:31 GMT 2004


> But I'm still in the market for a remote repository access
> solution...

I can't help you with a *nix solution (how about perl for reg
access?), but I can point you to a Windows program.

http://www.kixtart.org

This TINY program (241,664 bytes KIX32.EXE) is simply very easy to
use... just simple code in a text type file.

It can be copied to the NETLOGON share, and then the program can do
whatever you need.

For example, before I retired 1999, I had developed my own home
grown SMS like system for a company where I worked.  I managed
6000+ workstations/servers in 125 cities in 5 states.

I had 2000+ lines of code that would query *ALL* machines in my
domain, and put the results in a ".csv" file.  This file can then
be imported into your favorite database.

I don't have access to any of the code I wrote, but the "language"
is mostly just a super batch type language.

For example...
------------------------------------------------
;  DEMO.KIX
;
;  KiXtart demonstration script of registry functions.
;
;  24-Aug-1995
;
;  Note :  This code sample is provided for demonstration purposes
only.
;          Microsoft makes no warranty, either express or implied,
;          as to its usability in any given situation.
;

cls                                   ; clear the screen
color w+/n

? "START"

:start
if existkey( "HKEY_CURRENT_USER\KiX32" ) <> "0"
   if addkey( "HKEY_CURRENT_USER\KiX32" ) = 0
      color g+/n
      ? "OK, added KiX32 key."
      if addkey( "HKEY_CURRENT_USER\KiX32\one" ) = 0 AND
         addkey( "HKEY_CURRENT_USER\KiX32\two" ) = 0 AND
         addkey( "HKEY_CURRENT_USER\KiX32\three"
         ? "...and some subkeys..."
         if writevalue( "HKEY_CURRENT_USER\KiX32\one" , "value1" ,
"Text" , "REG_SZ" ) AND
            writevalue( "HKEY_CURRENT_USER\KiX32\one" , "value2" ,
"line1|line2(with a || in it)|line3|" , "REG_MULTI_SZ" ) AND
            writevalue( "HKEY_CURRENT_USER\KiX32\one" , "value3" ,
"0a12defa0b" , "REG_BINARY" ) AND
            writevalue( "HKEY_CURRENT_USER\KiX32\one" , "value4" ,
"123456789" , "REG_DWORD" )
            ? "...and now even some values..."
            ? "Please check the result with REGEDT32."
            ? ? "End of demo : press <anykey> to delete the key
again."
            get $x
            $result = deltree("HKEY_CURRENT_USER\KiX32")
            goto end
         else
            ? "Hmm, WriteValue failed with returncode : " + @error
         endif
      else
         ? "Hmm, AddKey failed with returncode : " + @error
      endif
   else
      ? "Hmm, AddKey failed with returncode : " + @error
      end
   endif
else
   ? "Huh ?. Key already exists ?!?."
   ? "Do you want me to delete it  (Y/N) ?."

   :loop
   GET $Input
   if $Input = "Y"
      if Deltree( "HKEY_CURRENT_USER\KiX32" )= 0
         ? "OK, Key deleted......"
         goto start
      else
         ? "Hmmm, somehow the delete failed : " + $RC
         exit
      endif
   else
      if $Input = "N"
         ? "OK, then I'll just quit."
         goto end
      else
         goto loop     ; wrong key, try again
      endif
   endif
endif

:end

color w+/n

? ? "END"

color w/n
------------------------------------

HTH

Mike

-- 
SuSE 9.0 Pro (2.4.21-192-default) with samba-2.2.8a-107


More information about the samba mailing list