• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Reg Query with 0.11.11 client

    Scheduled Pinned Locked Moved Unsolved
    FOG Problems
    4
    9
    2.3k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      jmeyer
      last edited by jmeyer

      Server
      • FOG Version: 1.3.5
      • OS: Ubuntu
      Client
      • Service Version: 0.11.11
      • OS: Windows 10 pro 64 bits
      Description

      I run a script that write on a network share and use reg query.
      It was working fine on 1.3.4 but since i have updated to 1.3.5, some commands doesn’t look to work.
      I can write in local (such as c:) but not using \aComputerName\Myshare even using a “net use”.
      Reg query doesn’t return anything neither.

      These are the test I have done writing localy

      echo 1. blablabla >> C:\logs.txt
      REG QUERY %KEY_NAME% /v %VALUE_NAME% >> C:\logs.txt
      echo 3. %KEY_NAME% >> C:\logs.txt
      echo 4. %VALUE_NAME% >> C:\logs.txt
      echo 5. titi;toto;tata >> C:\logs.txt
      echo 6. %COMPUTERNAME%;%ValueValue% >> C:\logs.txt
      

      Here are the results :

      1. blablabla 
      3. HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate 
      4. SusClientId 
      5. titi;toto;tata 
      6. console; 
      
      1 Reply Last reply Reply Quote 0
      • J
        jmeyer
        last edited by

        ------------------------------------------------------------------------------
        ---------------------------------SnapinClient---------------------------------
        ------------------------------------------------------------------------------
         20/03/2017 16:38 Client-Info Client Version: 0.11.11
         20/03/2017 16:38 Client-Info Client OS:      Windows
         20/03/2017 16:38 Client-Info Server Version: 1.3.5
         20/03/2017 16:38 Middleware::Response Success
         20/03/2017 16:38 SnapinClient Snapin Found:
         20/03/2017 16:38 SnapinClient     ID: 272
         20/03/2017 16:38 SnapinClient     Name: WSUS ID
         20/03/2017 16:38 SnapinClient     Created: 2017-03-20 15:38:00
         20/03/2017 16:38 SnapinClient     Action: 
         20/03/2017 16:38 SnapinClient     Pack: False
         20/03/2017 16:38 SnapinClient     Hide: False
         20/03/2017 16:38 SnapinClient     Server: 
         20/03/2017 16:38 SnapinClient     TimeOut: 0
         20/03/2017 16:38 SnapinClient     RunWith: cmd.exe
         20/03/2017 16:38 SnapinClient     RunWithArgs: /c
         20/03/2017 16:38 SnapinClient     Args: 
         20/03/2017 16:38 SnapinClient     File: SusClientId.cmd
         20/03/2017 16:38 Middleware::Communication Download: http://fogserver/fog/service/snapins.file.php?mac=4C:CC:6A:32:E5:4B||00:00:00:00:00:00:00:E0&taskid=272
         20/03/2017 16:38 SnapinClient C:\Program Files (x86)\FOG\tmp\SusClientId.cmd
         20/03/2017 16:38 Bus {
          "self": true,
          "channel": "Notification",
          "data": "{\r\n  \"title\": \"Installation de WSUS ID\",\r\n  \"message\": \"Ne pas éteindre l'ordinateur tant que la tâche n'est pas terminée\"\r\n}"
        }
         20/03/2017 16:38 Bus Emmiting message on channel: Notification
         20/03/2017 16:38 SnapinClient Starting snapin...
         20/03/2017 16:38 SnapinClient Snapin finished
         20/03/2017 16:38 SnapinClient Return Code: 0
         20/03/2017 16:38 Bus {
          "self": true,
          "channel": "Notification",
          "data": "{\r\n  \"title\": \"WSUS ID installé\",\r\n  \"message\": \"L’installation est terminée, prêt pour l'utilisation\"\r\n}"
        }
         20/03/2017 16:38 Bus Emmiting message on channel: Notification
         20/03/2017 16:38 Middleware::Communication URL: http://fogserver/fog/service/snapins.checkin.php?taskid=272&exitcode=0&mac=4C:CC:6A:32:E5:4B||00:00:00:00:00:00:00:E0&newService&json
        ------------------------------------------------------------------------------
        
        1 Reply Last reply Reply Quote 0
        • Tom ElliottT
          Tom Elliott
          last edited by

          Is this a command or a batch file?

          Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

          Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

          Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

          J 1 Reply Last reply Reply Quote 0
          • J
            jmeyer @Tom Elliott
            last edited by

            Yes it is. Here is the orginal code :

            @echo OFF
            
            setlocal ENABLEEXTENSIONS
            set KEY_NAME=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate
            set VALUE_NAME=SusClientId
            
            FOR /F "tokens=1-3" %%A IN ('REG QUERY %KEY_NAME% /v %VALUE_NAME% 2^>nul') DO (
                set ValueName=%%A
                set ValueType=%%B
                set ValueValue=%%C
            )
            
            if defined ValueName (
            	echo %COMPUTERNAME%;%ValueValue% >> \\console\wsusclients$\logs.csv
            )
            
            1 Reply Last reply Reply Quote 0
            • J
              Joe Schmitt Senior Developer
              last edited by

              @jmeyer said in Reg Query with 0.11.11 client:

              \\console\wsusclients

              When using network shares with the FOG client you have to take extra steps. More than likely your share is restricted to AD bound computers. While technically the computer running the script may be bound to that domain, the client runs as SYSTEM, which is the local, unbounded, machine. Your best bet would be to create an anonymous read/write share, or mount the share using RunWithArgs and setting Hide.

              Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

              J 1 Reply Last reply Reply Quote 0
              • J
                jmeyer @Joe Schmitt
                last edited by jmeyer

                @Joe-Schmitt That’s what I did. Hidden share with full rights for everybody.
                0_1490100750932_upload-8e7a1ce9-c6c8-4ae7-a79d-814c2cc89026

                0_1490100594460_upload-e0a2ee84-7e11-4ed0-9d89-9ad6bac85ecb

                J 1 Reply Last reply Reply Quote 0
                • J
                  jmeyer @jmeyer
                  last edited by jmeyer

                  I kind of make errors using “if defined ValueName ()” command.
                  To confirm that “reg query” is the problem and that i don’t have problem of rights to create a directory, I have tested again with these two lines in my script.
                  ( because I just realised that topic was a bit focusing on the wrong thing)

                  if defined ValueName (echo %COMPUTERNAME%;%ValueValue% >> \\console\wsusclients$\logs.csv)
                  echo %COMPUTERNAME%;%ValueValue% >> \\console\wsusclients$\logs.csv
                  

                  I have only one line in the logs.csv that is

                  console;
                  

                  It means ValueName has no value.

                  1 Reply Last reply Reply Quote 0
                  • J
                    jmeyer
                    last edited by jmeyer

                    Tested using VBS.
                    Result is the same and even

                    objShell.ExpandEnvironmentStrings( "%COMPUTERNAME%" )
                    

                    return nothing.

                    1 Reply Last reply Reply Quote 0
                    • x23piracyX
                      x23piracy
                      last edited by

                      Hi,

                      try this style:

                      FOR /F "tokens=4 skip=3" %%i IN ('REG QUERY "HKLM\Software\Firma\Produkt" /ve') DO SET Pfad=%%i```

                      ║▌║█║▌│║▌║▌█

                      1 Reply Last reply Reply Quote 0
                      • 1 / 1
                      • First post
                        Last post

                      181

                      Online

                      12.1k

                      Users

                      17.3k

                      Topics

                      155.3k

                      Posts
                      Copyright © 2012-2024 FOG Project