Conditional execution of a snapin ?



  • Hi,
    I have a script deployed by a snapin that works when I created a task from advanced tab, but fail after reimaging because it need domain credentials.
    How can I make some snapins to waiting for domain integration ? or don’t removing the task if the exit code is not good in the first run ?



  • @Tom-Elliott Yes. Where can I do it ?


  • Senior Developer

    @Cyril-Fleury So this can be solved?



  • Yes, it access to a network share, and fix ACL in local filesystem.
    I added more verification step in the script, and now it just works.
    My bad.

    Fog Version 1.3.4 (SVN Revision: 6066), client 0.11.9

    Snapin Log in Report Management:

    modif_acl_oubliee_v1	Complete	-1		2017-04-03	16:01:39
    modif_acl_oubliee_v1	Complete	0		2017-04-03	16:01:39
    

    fog.log

    ------------------------------------------------------------------------------
    --------------------------------HostnameChanger-------------------------------
    ------------------------------------------------------------------------------
     05/04/2017 13:10 Client-Info Client Version: 0.11.9
     05/04/2017 13:10 Client-Info Client OS:      Windows
     05/04/2017 13:10 Client-Info Server Version: 1.3.4
     05/04/2017 13:10 Middleware::Response Success
     05/04/2017 13:10 HostnameChanger Checking Hostname
     05/04/2017 13:10 HostnameChanger Removing host from domain
     05/04/2017 13:10 HostnameChanger Renaming host to test-deploy
     05/04/2017 13:10 Power Creating shutdown request
     05/04/2017 13:10 Power Parameters: /r /c "FOG needs to rename your computer" /t 0
     05/04/2017 13:10 Bus {
      "self": true,
      "channel": "Power",
      "data": "{\r\n  \"action\": \"shuttingdown\"\r\n}"
    }
     05/04/2017 13:10 Bus Emmiting message on channel: Power
    ------------------------------------------------------------------------------
    
     05/04/2017 13:12 Service Starting service
    
    ------------------------------------------------------------------------------
    --------------------------------HostnameChanger-------------------------------
    ------------------------------------------------------------------------------
     05/04/2017 13:13 Client-Info Client Version: 0.11.9
     05/04/2017 13:13 Client-Info Client OS:      Windows
     05/04/2017 13:13 Client-Info Server Version: 1.3.4
     05/04/2017 13:13 Middleware::Response Success
     05/04/2017 13:13 HostnameChanger Checking Hostname
     05/04/2017 13:13 HostnameChanger Hostname is correct
     05/04/2017 13:13 HostnameChanger Attempting to join domain
     05/04/2017 13:13 HostnameChanger Success, code =  0
     05/04/2017 13:13 Power Creating shutdown request
     05/04/2017 13:13 Power Parameters: /r /c "Host joined to Active Directory, restart required" /t 0
     05/04/2017 13:13 Bus {
      "self": true,
      "channel": "Power",
      "data": "{\r\n  \"action\": \"shuttingdown\"\r\n}"
    }
     05/04/2017 13:13 Bus Emmiting message on channel: Power
    ------------------------------------------------------------------------------
    
     05/04/2017 13:16 Service Starting service
    
    ------------------------------------------------------------------------------
    --------------------------------HostnameChanger-------------------------------
    ------------------------------------------------------------------------------
     05/04/2017 12:16 Client-Info Client Version: 0.11.9
     05/04/2017 12:16 Client-Info Client OS:      Windows
     05/04/2017 12:16 Client-Info Server Version: 1.3.4
     05/04/2017 12:16 Middleware::Response Success
     05/04/2017 12:16 HostnameChanger Checking Hostname
     05/04/2017 12:16 HostnameChanger Hostname is correct
     05/04/2017 12:16 HostnameChanger Attempting to join domain
     05/04/2017 12:16 HostnameChanger Host is already joined to target domain
    ------------------------------------------------------------------------------
    
    
    ------------------------------------------------------------------------------
    ---------------------------------SnapinClient---------------------------------
    ------------------------------------------------------------------------------
     05/04/2017 12:16 Client-Info Client Version: 0.11.9
     05/04/2017 12:16 Client-Info Client OS:      Windows
     05/04/2017 12:16 Client-Info Server Version: 1.3.4
     05/04/2017 12:16 Middleware::Response Success
     05/04/2017 12:16 SnapinClient Snapin Found:
     05/04/2017 12:16 SnapinClient     ID: 108
     05/04/2017 12:16 SnapinClient     Name: modif_acl_oubliee_v2
     05/04/2017 12:16 SnapinClient     Created: 2017-04-05 11:17:40
     05/04/2017 12:16 SnapinClient     Action: 
     05/04/2017 12:16 SnapinClient     Pack: False
     05/04/2017 12:16 SnapinClient     Hide: False
     05/04/2017 12:16 SnapinClient     Server: 
     05/04/2017 12:16 SnapinClient     TimeOut: 0
     05/04/2017 12:16 SnapinClient     RunWith: cmd.exe
     05/04/2017 12:16 SnapinClient     RunWithArgs: /c
     05/04/2017 12:16 SnapinClient     Args: 
     05/04/2017 12:16 SnapinClient     File: modif_acl_oubliee_v2.bat
     05/04/2017 12:16 Middleware::Communication Download: http://srv-image/fog/service/snapins.file.php?mac=F0:4D:A2:30:6D:81||00:00:00:00:00:00:00:E0&taskid=108
     05/04/2017 12:17 SnapinClient C:\Program Files (x86)\FOG\tmp\modif_acl_oubliee_v2.bat
     05/04/2017 12:17 Bus {
      "self": true,
      "channel": "Notification",
      "data": "{\r\n  \"title\": \"Installation de modif_acl_oubliee_v2\",\r\n  \"message\": \"Ne pas éteindre l'ordinateur tant que la tâche n'est pas terminée\"\r\n}"
    }
     05/04/2017 12:17 Bus Emmiting message on channel: Notification
     05/04/2017 12:17 SnapinClient Starting snapin...
     05/04/2017 12:18 SnapinClient Snapin finished
     05/04/2017 12:18 SnapinClient Return Code: 0
     05/04/2017 12:18 Bus {
      "self": true,
      "channel": "Notification",
      "data": "{\r\n  \"title\": \"modif_acl_oubliee_v2 installé\",\r\n  \"message\": \"L’installation est terminée, prêt pour l'utilisation\"\r\n}"
    }
     05/04/2017 12:18 Bus Emmiting message on channel: Notification
     05/04/2017 12:18 Middleware::Communication URL: http://srv-image/fog/service/snapins.checkin.php?taskid=108&exitcode=0&mac=F0:4D:A2:30:6D:81||00:00:00:00:00:00:00:E0&newService&json
    ------------------------------------------------------------------------------
    
    ------------------------------------------------------------------------------
    --------------------------------HostnameChanger-------------------------------
    ------------------------------------------------------------------------------
     05/04/2017 12:20 Client-Info Client Version: 0.11.9
     05/04/2017 12:20 Client-Info Client OS:      Windows
     05/04/2017 12:20 Client-Info Server Version: 1.3.4
     05/04/2017 12:20 Middleware::Response Success
     05/04/2017 12:20 HostnameChanger Checking Hostname
     05/04/2017 12:20 HostnameChanger Hostname is correct
     05/04/2017 12:20 HostnameChanger Attempting to join domain
     05/04/2017 12:20 HostnameChanger Host is already joined to target domain
    ------------------------------------------------------------------------------
    
    ------------------------------------------------------------------------------
    ---------------------------------SnapinClient---------------------------------
    ------------------------------------------------------------------------------
     05/04/2017 12:20 Client-Info Client Version: 0.11.9
     05/04/2017 12:20 Client-Info Client OS:      Windows
     05/04/2017 12:20 Client-Info Server Version: 1.3.4
     05/04/2017 12:20 Middleware::Response No valid tasks found
    ------------------------------------------------------------------------------
    

  • Senior Developer

    @Cyril-Fleury said in Conditional execution of a snapin ?:

    How can I make some snapins to waiting for domain integration ?

    Are you using a network share in your script?


  • Senior Developer

    Why not refactor the snapin to work without those requirements?

    I’m pretty sure fog client will attempt to rename and join your system to a domain before the snapin runs (and your device will reboot before it will run as well). Maybe there?

    Can you provide your Client logs?

    What Version of the FOG Client are you running?
    What Version of the FOG Server are you running?


Log in to reply
 

355
Online

39.3k
Users

11.0k
Topics

104.4k
Posts

Looks like your connection to FOG Project was lost, please wait while we try to reconnect.