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

    PowerShell Scripts in FOG Snapins

    Scheduled Pinned Locked Moved Solved
    General
    2
    6
    1.3k
    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.
    • imagingmaster21I
      imagingmaster21
      last edited by

      So what is settings to get a powershell script to work. I have one that does a custom start menu layout and I am unable to get it to run. If I run it manually on a machine it works. What is need in the snappin settings to make a ps1 file execute?

      1 Reply Last reply Reply Quote 0
      • george1421G
        george1421 Moderator
        last edited by

        The fog client should run the powershell script no problem. What may be your problem is whom the powershell script runs as.

        The FOG client runs as user SYSTEM (which has no visible desktop). So your powershell script is probably running perfectly fine for SYSTEM. But what I imagine you are trying to do is mess with either the current logged in user or hklm via powershell. That won’t work so well.

        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!

        imagingmaster21I 1 Reply Last reply Reply Quote 0
        • george1421G
          george1421 Moderator
          last edited by

          [Mod Note] Moving this thread out of the tutorials forum.

          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!

          imagingmaster21I 1 Reply Last reply Reply Quote 0
          • imagingmaster21I
            imagingmaster21 @george1421
            last edited by

            @george1421
            So how would I get it to work under current user? What would be the easiest way. Or is there something I can put in the file to run as system?

            george1421G 1 Reply Last reply Reply Quote 0
            • george1421G
              george1421 Moderator @imagingmaster21
              last edited by george1421

              @imagingmaster21 That may be a question for our FOG Client @Developers on how/if its possible to run a snapin as the current logged on user.

              The only way I found is to leave what I call bread crumbs for the users to find. The concept is that you use a plugin to update a registry key to have a script run like in HKLM/Software/…/Run which will be executed each time a user logs in. Then have that script run in the user’s context.

              The other way I’ve done it is to use a plugin to drop any necessary files, then use a GPO to update what needs to be done. You can either use a Policy pro Policy Preference to set what needs to be set.

              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!

              1 Reply Last reply Reply Quote 0
              • imagingmaster21I
                imagingmaster21 @george1421
                last edited by

                @george1421
                I was able to get the one Powershell script to work via a Batch file. But I am having problems getting this bat file to work:
                PowerShell.exe -Command “&Import-StartLayout –LayoutPath C:\Installs\StartMenu.xml –MountPath $env:SystemDrive”

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

                160

                Online

                12.0k

                Users

                17.3k

                Topics

                155.2k

                Posts
                Copyright © 2012-2024 FOG Project