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

Help with creating a PowerShell Snapin

Scheduled Pinned Locked Moved
FOG Problems
8
20
8.7k
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.
  • B
    BigDawg986
    last edited by Mar 12, 2014, 11:29 PM

    [quote=“Albatros, post: 24014, member: 16710”]FOG can run batch files, no need to create a exe file for that. I however create a exe file If I have more than 1 file to run.[/quote]

    I have a lot of batch files. I use psexec to push them to all my hosts to deploy software etc. Can someone tell me how to use these batch files as a FOG snap-in?

    1 Reply Last reply Reply Quote 0
    • A
      Albatros
      last edited by Mar 13, 2014, 7:02 AM

      Do you know this tutorial?
      [url]http://fogproject.org/forum/threads/how-to-make-a-simple-snapin-start-to-finish.304/[/url]

      With the help of the tutorial you can make a exe file that contains a 7-zip file and this file contains batch files.

      1 Reply Last reply Reply Quote 0
      • B
        BigMan99211
        last edited by Mar 14, 2014, 8:51 AM

        Thanks for the post Albatros. I did already see that. It needs a little updating though, as the guide is following an older version, and they’ve changed the interface a little. But, overall I still got it to work. I now have a full zero touch deployment system with deployment of any software package I choose.

        My next goal is to make a script that will check daily for Flash and Java updates. When it finds one, the plan is to have the script change out the existing installer with the new one, then somehow notify FOG to reset the snapin deployment to all machines in a group. This should essentially create a sort of Auto Updater…

        "Failure is not an option. It come pre-installed on Windows…" - Anonymous

        "Life is hard; It's harder if you're stupid" - John Wayne

        1 Reply Last reply Reply Quote 0
        • B
          BigMan99211
          last edited by Mar 14, 2014, 8:56 AM

          OOOHH… Just had an epiphany as 5am… 😄

          Better yet, I’ll just have a machine group set up in PDQ Deploy, with all of the same machines that are in the FOG group. This way, I can just have the script talk directly to the PDQ Deploy machine group, instead of going all the way out and through FOG.

          "Failure is not an option. It come pre-installed on Windows…" - Anonymous

          "Life is hard; It's harder if you're stupid" - John Wayne

          1 Reply Last reply Reply Quote 0
          • B
            Bob Henderson
            last edited by May 12, 2015, 7:20 PM

            [quote=“BigMan99211, post: 24135, member: 21932”]OOOHH… Just had an epiphany as 5am… 😄

            Better yet, I’ll just have a machine group set up in PDQ Deploy, with all of the same machines that are in the FOG group. This way, I can just have the script talk directly to the PDQ Deploy machine group, instead of going all the way out and through FOG.[/quote]

            Any more updates at this? I’ve just got the script working to pull updates from PDQDeploy on the machine, but am wondering how to fire it off after an image. Are you still using a snappin, or something different? I’d love to get this r unning, as I’ve got 1200 machines to image next month…

            1 Reply Last reply Reply Quote 0
            • B
              Bob Henderson
              last edited by May 12, 2015, 7:21 PM

              [quote=“Bob Henderson, post: 47213, member: 1291”]Any more updates at this? I’ve just got the script working to pull updates from PDQDeploy on the machine, but am wondering how to fire it off after an image. Are you still using a snappin, or something different? I’d love to get this r unning, as I’ve got 1200 machines to image next month…[/quote]

              And yes, thread necro, but for relevance!

              1 Reply Last reply Reply Quote 0
              • W
                Wayne Workman
                last edited by May 12, 2015, 10:04 PM

                If you have a domain, there is zero reasons to “Deploy” a powershell script.

                Powershell can control domain-connected clients like puppets. You can literally push out whatever you want to whatever computer you want, instantly, from powershell itself on a DC.

                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!
                Daily Clean Installation Results:
                https://fogtesting.fogproject.us/
                FOG Reporting:
                https://fog-external-reporting-results.fogproject.us/

                1 Reply Last reply Reply Quote 0
                • B
                  Bob Henderson
                  last edited by May 12, 2015, 11:18 PM

                  [quote=“Wayne Workman, post: 47235, member: 28155”]If you have a domain, there is zero reasons to “Deploy” a powershell script.

                  Powershell can control domain-connected clients like puppets. You can literally push out whatever you want to whatever computer you want, instantly, from powershell itself on a DC.[/quote]

                  Completely understood. Problem is, I’m doing something a bit different. To lay it out easily:

                  1. I create a base image (Windows 7 + Office2013) and get it all sysprepped and into FOG.
                  2. I deploy base image to various hardware.
                  3. I have this script to invoke a deployment job using PDQ deploy to install the rest of my packages in their updated versions.

                  I’d love to get it so that that script fires off automatically. Problem is, since it’s powershell using WinRM to invoke the PDQ Deploy command, I need to be domain joined. If I’m not mistaken, this puts adding the script to the SetupComplete.cmd file out of the question, as the domainjoin from FOG hasn’t ran yet.

                  Any suggestions?

                  1 Reply Last reply Reply Quote 0
                  • W
                    Wayne Workman
                    last edited by May 13, 2015, 12:39 AM

                    I suppose you could use the “RunOnce” registry value, and put a batch script on the image. You can raise elevation within a batch script, and then run a powershell script from that.

                    The pointer will point to a network share where your actual script is, perhaps copy it down and run it locally.

                    But yeah you’re right, without being joined to the domain… you have to do other things. I used to to something similar to the above back in college, but using nothing but batch files. It worked really well, long as the share path and remote script name never changed; which wasn’t an issue.

                    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!
                    Daily Clean Installation Results:
                    https://fogtesting.fogproject.us/
                    FOG Reporting:
                    https://fog-external-reporting-results.fogproject.us/

                    1 Reply Last reply Reply Quote 0
                    • B
                      Bob Henderson
                      last edited by May 13, 2015, 1:53 AM

                      Would run once work with domain join/rename bit of Fog? I’m worried that with the fact it usually gets to a login before domain join, then reboots, it would run and then fail.

                      1 Reply Last reply Reply Quote 0
                      • W
                        Wayne Workman
                        last edited by May 13, 2015, 2:38 AM

                        [quote=“Bob Henderson, post: 47245, member: 1291”]Would run once work with domain join/rename bit of Fog? I’m worried that with the fact it usually gets to a login before domain join, then reboots, it would run and then fail.[/quote]

                        No way to know but to try…

                        Set the FOG Client Service to delayed start?

                        You could also try a startup-script. You can set this via Local Group Policy on the image itself. Then, to get rid of it later once it’s on the domain, you can set policy to get rid of it on your DC.

                        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!
                        Daily Clean Installation Results:
                        https://fogtesting.fogproject.us/
                        FOG Reporting:
                        https://fog-external-reporting-results.fogproject.us/

                        1 Reply Last reply Reply Quote 0
                        • B
                          Bob Henderson
                          last edited by May 13, 2015, 12:49 PM

                          Sadly, tried that, no luck. Since it’s a powershell script, it really needs the domain to be working well, which means I cant have it on RunOnce registry unless I could somehow get that key added after the domainjoin task.

                          Startupscript via local group policy is an option I’ll be trying today. I’d just need to set the last step of the task to delete the script…

                          I’m honestly wondering how BigMan99211 got it working up there, and was hoping he’d chime in!

                          1 Reply Last reply Reply Quote 0
                          • d4rk3D
                            d4rk3
                            last edited by May 19, 2015, 3:05 AM

                            1. Re-package your desired software that you normally deploy with PDQ deploy into MSI’s (test all of them to confirm they install correctly).
                            2. Create Snapins and have them auto-deploy when desired.
                            3. ???
                            4. Profit!
                            1 Reply Last reply Reply Quote 1
                            • 1 / 1
                            • First post
                              Last post

                            167

                            Online

                            12.0k

                            Users

                            17.3k

                            Topics

                            155.2k

                            Posts
                            Copyright © 2012-2024 FOG Project