Fog Snapin not working 1.3.0-RC-8 Client 0.11.5



  • I am having trouble getting snapins to successfully deploy to a windows 7 host computer. I have tried to push a Batch file and a VBS file, with no success. I played with the settings to no avail, the computer reboots when I choose the reboot setting in the snapin options. Can anyone please help in troubleshooting. I made sure that the Scripts actually work on the windows 7 machine, it just doesn’t work when deployed from FOG.

    Client LOG:

    ------------------------------------------------------------------------------
    ---------------------------------SnapinClient---------------------------------
    ------------------------------------------------------------------------------
     8/12/2016 6:59 PM Client-Info Client Version: 0.11.5
     8/12/2016 6:59 PM Client-Info Client OS:      Windows
     8/12/2016 6:59 PM Client-Info Server Version: 1.3.0-RC-8
     8/12/2016 6:59 PM Middleware::Response Success
     8/12/2016 6:59 PM SnapinClient Snapin Found:
     8/12/2016 6:59 PM SnapinClient     ID: 13
     8/12/2016 6:59 PM SnapinClient     Name: Autologin_Student VB
     8/12/2016 6:59 PM SnapinClient     Created: 2016-08-12 18:58:44
     8/12/2016 6:59 PM SnapinClient     Action: 
     8/12/2016 6:59 PM SnapinClient     Pack: False
     8/12/2016 6:59 PM SnapinClient     Hide: False
     8/12/2016 6:59 PM SnapinClient     Server: http://10.9.3.244/fog
     8/12/2016 6:59 PM SnapinClient     TimeOut: 0
     8/12/2016 6:59 PM SnapinClient     RunWith: cscript.exe
     8/12/2016 6:59 PM SnapinClient     RunWithArgs: 
     8/12/2016 6:59 PM SnapinClient     Args: 
     8/12/2016 6:59 PM SnapinClient     File: Autologin_Student.vbs
     8/12/2016 6:59 PM Middleware::Communication Download: http://10.9.3.244/fog/service/snapins.file.php?mac=2C:41:38:AC:68:19|00:50:56:C0:00:01|00:50:56:C0:00:08&taskid=13
     8/12/2016 6:59 PM SnapinClient C:\Program Files (x86)\FOG\tmp\Autologin_Student.vbs
     8/12/2016 6:59 PM Bus {
      "self": true,
      "channel": "Notification",
      "data": "{\r\n  \"title\": \"Installing Autologin_Student VB\",\r\n  \"message\": \"Please do not shutdown until this is completed\"\r\n}"
    }
     8/12/2016 6:59 PM Bus Emmiting message on channel: Notification
     8/12/2016 6:59 PM SnapinClient Starting snapin...
     8/12/2016 6:59 PM SnapinClient Snapin finished
     8/12/2016 6:59 PM SnapinClient Return Code: 0
     8/12/2016 6:59 PM Bus {
      "self": true,
      "channel": "Notification",
      "data": "{\r\n  \"title\": \"Autologin_Student VB Installed\",\r\n  \"message\": \"Installation has finished and is now ready for use\"\r\n}"
    }
     8/12/2016 6:59 PM Bus Emmiting message on channel: Notification
     8/12/2016 6:59 PM Middleware::Communication URL: http://10.9.3.244/fog/service/snapins.checkin.php?taskid=13&exitcode=0&mac=2C:41:38:AC:68:19|00:50:56:C0:00:01|00:50:56:C0:00:08&newService&json
    

    Mod edited to use code box.


  • Moderator

    @Kleber Here’s a basic example that uses powershell with snapins - testing working on Win10. https://forums.fogproject.org/topic/8348/reset-local-windows-account-password-1-3-0



  • @Wayne-Workman Thanks for taking the time to help me with this. Currently, I can not even get a simple batch file to deploy to the computer. I will make a test script to log the vb script to see what the log outputs. I am also going to remove the part of the script that elevates the command, I usually do this because windows might throw a UAC prompt. I will get back to you on the results, hopefully sometime next week.

    Thanks for all your help!


  • Moderator

    @Kleber I talked with Joe briefly about this, he suggests to add logging to the vb script. Basically, output every variable to a text file, put messages everywhere that get put into a text file. For example “About to execute line 15” and " About to execute line 16" or “About to do step 20”. Adding logging at every point in the script will let you know how far it gets, and can lead us to figuring out what’s wrong.


  • Moderator

    @Kleber I’m not sure why it isn’t working. It could be a bug. We should wait for Joe’s response, he is the new client developer.



  • @Wayne-Workman
    The old client ran the script fine and it also runs under the system account. Maybe there is a bug with the new client.


  • Moderator

    @Kleber Because all snapins run as SYSTEM, try to remove this line and see what happens:

    " RunAsAdministrator", , "runas", 1
    

    Also, just thinking outloud here, no SYSTEM task can ever spawn a UI, ever. This is by design of Microsoft. It’s so users may never interact with any program that is running as SYSTEM.

    So - I’m not entirely sure its even possible to cause SYSTEM to do a login.

    Also think I need to ask @Joe-Schmitt to look. Sorry for pinging you so many times today, Joe.



  • @Wayne-Workman

    I went ahead and removed the fog client 0.11.5 and installed the legacy client on the computer and the script worked flawlessly. I am not sure why this is happening.



  • @Wayne-Workman

    Hi, I believe that VB script doesn’t have a try/catch, if you know of a way please point me in the right direction.


  • Moderator

    @Kleber Can you include a try - catch in the script and send the error to a file on the c:\ drive?



  • @Wayne-Workman
    Hi I tried doing it directly and it will not work.


  • Moderator

    @Kleber Just at first glance, you’re using a 2-piece script. A batch file that gets access to a share, and runs a vb script.

    You don’t need to do that in fog trunk. you can upload the vb script directly, the new fog client is capable of running vb script. There’s a template for vb script, even, in the snapins creation area.



  • @Wayne-Workman

    These scripts worked on Fog 1.2 not sure what changed



  • ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    Batch Script:
    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

    NET USE /USER:Domain\Servername \servername\deployment Password
    cscript \Server\deployment\Autologin\Autologin_Student.vbs

    :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    VB Script:
    :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    'Option Explicit

    'Global Vars
    	const HKLM = &H80000002
    	const COMPUTER = "."
    
    'Vars
    	dim objReg, objShell
    	dim strPath, strDefaultUserName, strDefaultPassword, strAutoAdminLogon, strDefaultDomainName, strAutoLogonCount, strForceAutoLogon
    	dim intGrade
    
    'Assign Vars
    	strPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\"
    	strDefaultUserName = "DefaultUserName"
    	strDefaultPassword = "DefaultPassword"
    	strAutoAdminLogon = "AutoAdminLogon"
    	strDefaultDomainName = "DefaultDomainName"
    	strAutoLogonCount = "AutoLogonCount"
    	strForceAutoLogon = "ForceAutoLogon"
    
    	Set WshShell = WScript.CreateObject("WScript.Shell")
    	If WScript.Arguments.length =0 Then
    	Set ObjShell = CreateObject("Shell.Application")
    	ObjShell.ShellExecute "wscript.exe", """" & _
    	WScript.ScriptFullName & """" &_
    	" RunAsAdministrator", , "runas", 1
    	Else		
    		
    		set objReg = GetObject("winmgmts:\\" & COMPUTER & "\root\default:StdRegProv")
    		set objShell = WScript.CreateObject("WScript.Shell")
    
    		objReg.SetStringValue HKLM, strPath, strDefaultUserName, "student" 'replace username with your username you want to use
    		objReg.SetStringValue HKLM, strPath, strDefaultPassword, "Password" 'replace password with your password you want to use
    		objReg.SetStringValue HKLM, strPath, strAutoAdminLogon, "1"
    		objReg.SetStringValue HKLM, strPath, strDefaultDomainName, "ET" 'replace domain with your domain
    		objReg.SetStringValue HKLM, strPath, strForceAutoLogon, "0"
    		objReg.DeleteValue HKLM, strPath, strAutoLogonCount
    
    	End If

  • Moderator

    All snapins run as the SYSTEM user (no, I’m not yelling, the user is all caps). This is the number 1 reason why scripts/programs will run manually, but not as a snapin.

    Can we have a copy of the script? Remove any sensitive data and replace those pieces with something else - so that the script is still structurally sound.


Log in to reply
 

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