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

    Powershell script snapin to install Windows calculator app not working

    Scheduled Pinned Locked Moved
    Windows Problems
    2
    7
    2.9k
    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.
    • G
      gabbas
      last edited by

      Hi, I am trying to run a PS script to install Windows 10 calculator (which was removed before deploying the OS to our lab PCs). When i run the script on a standalone machine, it works fine and I can open up the calculator. But when try to do it using Fog snapin, it does work, although the log doesn’t mention any error, any idea?

      -SnapinClient---------------------------------
      ------------------------------------------------------------------------------
       15/11/2018 14:15 Client-Info Version: 0.9.11
       15/11/2018 14:15 SnapinClient Running...
       15/11/2018 14:15 Middleware::Communication URL: http://10.1.63.202/fog/service/servicemodule-active.php?moduleid=snapinclient&mac=78:24:AF:39:06:00|00:50:56:C0:00:01|00:50:56:C0:00:08|&newService=1
       15/11/2018 14:15 Middleware::Communication Response: Success
       15/11/2018 14:15 Middleware::Communication URL: http://10.1.63.202/fog/service/snapins.checkin.php?mac=78:24:AF:39:06:00|00:50:56:C0:00:01|00:50:56:C0:00:08|&newService=1
       15/11/2018 14:15 Middleware::Communication Response: Success
       15/11/2018 14:15 SnapinClient Snapin Found:
       15/11/2018 14:15 SnapinClient     ID: 15110
       15/11/2018 14:15 SnapinClient     RunWith: powershell.exe
       15/11/2018 14:15 SnapinClient     RunWithArgs: 
       15/11/2018 14:15 SnapinClient     Name: Test  Calculator
       15/11/2018 14:15 SnapinClient     File: calculator.ps1
       15/11/2018 14:15 SnapinClient     Created: 2018-11-15 14:15:42
       15/11/2018 14:15 SnapinClient     Args: 
       15/11/2018 14:15 SnapinClient     Reboot: 0
       15/11/2018 14:15 Middleware::Communication URL: http://10.1.63.202/fog/service/snapins.file.php?mac=78:24:AF:39:06:00|00:50:56:C0:00:01|00:50:56:C0:00:08|&taskid=15110
       15/11/2018 14:15 Bus {
        "channel": "Notification",
        "data": "{\r\n  \"title\": \"Test  Calculator\",\r\n  \"message\": \"FOG is installing Test  Calculator\",\r\n  \"duration\": 10\r\n}"
      }
       15/11/2018 14:15 Bus Emmiting message on channel: Notification
       15/11/2018 14:15 SnapinClient Starting snapin...
       15/11/2018 14:15 SnapinClient Snapin finished
       15/11/2018 14:15 SnapinClient Return Code: 1
       15/11/2018 14:15 Bus {
        "channel": "Notification",
        "data": "{\r\n  \"title\": \"Finished Test  Calculator\",\r\n  \"message\": \"Test  Calculator finished installing\",\r\n  \"duration\": 10\r\n}"
      }
       15/11/2018 14:15 Bus Emmiting message on channel: Notification
       15/11/2018 14:15 Middleware::Communication URL: http://10.1.63.202/fog/service/snapins.checkin.php?taskid=15110&exitcode=1&mac=78:24:AF:39:06:00|00:50:56:C0:00:01|00:50:56:C0:00:08|&newService=1
       15/11/2018 14:15 Middleware::Communication URL: http://10.1.63.202/fog/service/snapins.checkin.php?mac=78:24:AF:39:06:00|00:50:56:C0:00:01|00:50:56:C0:00:08|&newService=1
       15/11/2018 14:15 Middleware::Communication Response: No snapins
      -----------------------------------------------------------------
      

      My snapin setting is:
      0_1542291850074_fog_error.png

      1 Reply Last reply Reply Quote 0
      • S
        Sebastian Roth Moderator
        last edited by

        @gabbas said:

        Client-Info Version: 0.9.11

        That client version is pretty dated so probably your FOG server is as well? Are you possibly deploying Win 10 images with that? Would not have though this to work.

        But anyway. We can try to help you but if the issue needs fixing in the code we’d need to ask you to update to the latest versions as we don’t have the time to backport any fixes to older versions.

        The best you can do I suppose is add debug output to your script like logging messages to a file on disk and see where it fails.

        The fog-client runs as a service and so do the commands and scripts you tell it to execute. Probably that is why it works when run by hand but not via fog-client.

        Please post the full script here so we can help fixing it.

        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

        1 Reply Last reply Reply Quote 0
        • G
          gabbas
          last edited by Sebastian Roth

          Hi, yes I need to update the fog but its pretty stable version and its doing everything I need to do in our environment, but I agree, i am going to update it at some point. Please see the script below:

          Get-AppxPackage -allusers *windowscalculator* | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register “$($_.InstallLocation)\AppXManifest.xml”}
          
          1 Reply Last reply Reply Quote 0
          • S
            Sebastian Roth Moderator
            last edited by

            @gabbas You might want to give this a try to see if your powershell script is running properly in the context of the SYSTEM user. Download PsExec tool and then from an admin command shell run:

            C:\Windows\system32>whoami
            ...\Administrator
            
            C:\Windows\system32>PsExec.exe -S cmd.exe
            
            PsExec v2.2 - Execute processes remotely
            Copyright (C) 2001-2016 Mark Russinovich
            Sysinternals - www.sysinternals.com
            
            
            Microsoft Windows [version 6.1.7601]
            Copyright (c) 2009 Microsoft Corporation. Tous droits réservés.
            
            C:\Windows\system32>whoami
            NT AUTHORITY\SYSTEM
            
            C:\Windows\system32>powershell C:\path\to\script\calculator.ps1
            ...
            

            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

            G 1 Reply Last reply Reply Quote 0
            • G
              gabbas @Sebastian Roth
              last edited by

              @Sebastian-Roth Thank you, I have tried to run the commands and got this error, so its to do with the account, any idea how can I get it working?

              C:\Windows\system32>powershell C:\Users\gabbas_adm\Desktop\Scripts\calculator.ps1
              Add-AppxPackage : Deployment failed with HRESULT: 0x80073CF9, Install failed.
              Please contact your software vendor. (Exception from HRESULT: 0x80073CF9)
              Deployment Register operation rejected on package
              Microsoft.VCLibs.120.00_12.0.21005.1_x86__8wekyb3d8bbwe from: AppXManifest.xml
              install request because the Local System account is not allowed to perform
              this operation.
              NOTE: For additional information, look for [ActivityId]
              5243e6bd-7b72-0000-6bd3-4752727bd401 in the Event Log or use the command line
              Get-AppxLog -ActivityID 5243e6bd-7b72-0000-6bd3-4752727bd401
              At C:\Users\gabbas_adm\Desktop\Scripts\calculator.ps1:1 char:38
              + ...  | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.I ...
              +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                  + CategoryInfo          : WriteError: (C:\Program File...ppXManifest.xml:S
                 tring) [Add-AppxPackage], IOException
                  + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageMa
                 nager.Commands.AddAppxPackageCommand```
              1 Reply Last reply Reply Quote 0
              • S
                Sebastian Roth Moderator
                last edited by

                @gabbas said in Powershell script snapin to install Windows calculator app not working:

                Microsoft.VCLibs.120.00_12.0.21005.1_x86__8wekyb3d8bbwe from: AppXManifest.xml
                install request because the Local System account is not allowed to perform
                this operation.
                

                To me it sounds as if you simply can’t install apps from the SYSTEM context. Read this here as well: https://nikifoster.wordpress.com/2013/04/

                I can’t really see what we can do about this as we don’t know the user you want to install this to. Can’t you just run it as domain logon script?

                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

                G 1 Reply Last reply Reply Quote 0
                • G
                  gabbas @Sebastian Roth
                  last edited by

                  @Sebastian-Roth I have tried to run it as a domain log-on script but it didnt work, I can still install some apps ( prepared using SFX maker as silent install through Fog Snapin) but none of the script is working. I would appreciate if you kindly advise me? Many thanks

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

                  153

                  Online

                  12.0k

                  Users

                  17.3k

                  Topics

                  155.2k

                  Posts
                  Copyright © 2012-2024 FOG Project