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

    Powershell Snapin

    Scheduled Pinned Locked Moved Solved
    FOG Problems
    3
    9
    2.2k
    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.
    • M
      msaglioc99
      last edited by

      This post is deleted!
      1 Reply Last reply Reply Quote 0
      • M
        msaglioc99
        last edited by Tom Elliott

        function Pin-App {    param(
                [string]$appname,
                [switch]$unpin
            )
            try{
                if ($unpin.IsPresent){
                    ((New-Object -Com Shell.Application).NameSpace('shell:::{4234d49b-0245-4df3-b780-3893943456e1}').Items() | ?{$_.Name -eq $appname}).Verbs() | ?{$_.Name.replace('&','') -match 'Von "Start" lösen|Unpin from Start'} | %{$_.DoIt()}
                    return "App '$appname' unpinned from Start"
                }else{
                    ((New-Object -Com Shell.Application).NameSpace('shell:::{4234d49b-0245-4df3-b780-3893943456e1}').Items() | ?{$_.Name -eq $appname}).Verbs() | ?{$_.Name.replace('&','') -match 'An "Start" anheften|Pin to Start'} | %{$_.DoIt()}
                    return "App '$appname' pinned to Start"
                }
            }catch{
                Write-Error "Error Pinning/Unpinning App! (App-Name correct?)"
            }
        }
        
        Pin-App "Mail" -unpin
        Pin-App "Store" -unpin
        Pin-App "Calendar" -unpin
        Pin-App "Microsoft Edge" -unpin
        Pin-App "Photos" -unpin
        Pin-App "Cortana" -unpin
        Pin-App "Weather" -unpin
        Pin-App "Phone Companion" -unpin
        Pin-App "Twitter" -unpin
        Pin-App "Skype Video" -unpin
        Pin-App "Candy Crush Soda Saga" -unpin
        Pin-App "xbox" -unpin
        Pin-App "Groove music" -unpin
        Pin-App "films & tv" -unpin
        Pin-App "microsoft solitaire collection" -unpin
        Pin-App "money" -unpin
        Pin-App "get office" -unpin
        Pin-App "onenote" -unpin
        Pin-App "news" -unpin
        Pin-App "Asphalt 8: Airborne" -unpin
        Pin-App "This PC" -pin
        Pin-App "Alarms & Clock" -unpin
        Pin-App "Skype" -unpin
        Pin-App "This PC" -unpin
        Pin-App "Code Writer" -unpin 
        Pin-App "Eclipse Manager" -unpin 
        Pin-App "Movies & Tv" -unpin 
        Pin-App "Calculator" -unpin 
        Pin-App "Sway" -unpin 
        Pin-App "Microsoft Sway" -unpin 
        Pin-App "Pandora" -unpin 
        Pin-App "Maps" -unpin 
        Pin-App "Microsoft Remote Desktop" -unpin 
        Pin-App "NetworkSpeedTest" -unpin
        Pin-App "Duolingo" -unpin
        Pin-App "Pandora" -unpin
        
        1 Reply Last reply Reply Quote 0
        • Tom ElliottT
          Tom Elliott
          last edited by

          Does the script run independently from snapins? meaning, Can you test it from the machine you want this to work from and it works?

          Mind you, I suspect you may need to add -ExecutionPolicy unrestricted to run with arguments element.

          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

          1 Reply Last reply Reply Quote 0
          • M
            msaglioc99
            last edited by

            If I manually run the script on the machine I wanna send it to via snapin it works successfully. 0_1499695902345_unpin programs.PNG

            1 Reply Last reply Reply Quote 0
            • Tom ElliottT
              Tom Elliott
              last edited by

              Then the question I suppose would be:

              Does your script work from a user perspective? Remember snapins run as the SYSTEM user, so removing applications in the manner, as I understand it, is relevant to the SYSTEM user not the logged in user.

              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

              1 Reply Last reply Reply Quote 0
              • M
                msaglioc99
                last edited by

                @Tom-Elliott said in Powershell Snapin:

                r script work from a user perspective? Remember snapins run as the SYSTEM user, so removing applications in the manner, as I understand it, is relevant to the SYSTEM user not the logged in user.

                logged in as a user I am able to run the script. What “system” user is the fog script running as?

                Tom ElliottT 1 Reply Last reply Reply Quote 0
                • Tom ElliottT
                  Tom Elliott @msaglioc99
                  last edited by

                  @msaglioc99 It’s literally “SYSTEM” user.

                  This is WIndows equivalent of “ROOT” with some caveats.

                  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

                  1 Reply Last reply Reply Quote 0
                  • AvaryanA
                    Avaryan
                    last edited by

                    Does this script unpin the apps for all users or just the currently logged in user?

                    1 Reply Last reply Reply Quote 0
                    • M
                      msaglioc99
                      last edited by

                      @Avaryan said in Powershell Snapin:

                      unpin the apps for all users or just the

                      Currently logged in user. If there’s a way to set it up for all users that’s what I would prefer.

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

                      248

                      Online

                      12.0k

                      Users

                      17.3k

                      Topics

                      155.2k

                      Posts
                      Copyright © 2012-2024 FOG Project