banner



Run Windows PowerShell scripts first at logon, logoff, startup, shutdown

If yous want to run Windows PowerShell scripts first at user logon, logoff, startup, and shutdown, here is what you will accept to do. Yous can prioritize Windows PowerShell scripts earlier non-PowerShell scripts using Local Group Policy Editor and Registry Editor.

When a user logs on or starts up the computer, all the scripts run simultaneously. It may cause some delay in the startup or running a specific program. It is oftentimes required to run all the Windows PowerShell scripts and Group Policy Object to run before not-PowerShell scripts.

Run Windows PowerShell scripts starting time

To run Windows PowerShell scripts first at user logon, logoff, startup, and shutdown, follow these steps-

  1. Printing Win+R.
  2. Type gpedit.msc and hit the Enter button.
  3. Go to Scripts in Computer Configuration.
  4. Double-click on Run Windows PowerShell scripts beginning at user logon, logoff.
  5. Select the Enabled pick.
  6. Click Utilize and OK.
  7. Double-click on Run Windows PowerShell scripts offset at computer startup, shutdown.
  8. Select the Enabled option.
  9. Click Utilize and OK.

Let's check out these steps in detail.

At first, you volition accept to open the Local Group Policy Editor. For that, printingWin+R, type gpedit.msc, and striking theEnterbutton. Later on opening it, navigate to the following path-

Computer Configuration > Administrative Templates > System > Scripts

You volition encounter two settings called:

  • Run Windows PowerShell scripts commencement at user logon, logoff,
  • Run Windows PowerShell scripts first at reckoner startup, shutdown.

Double-click on each of them, and select theEnabledchoice.

Run Windows PowerShell scripts first at user logon, logoff, startup, and shutdown

Click theUtilizeandOKto save the change.

Run Windows PowerShell scripts outset at user logon, logoff, startup, and shutdown using Registry Editor

To run Windows PowerShell scripts commencement at user logon, logoff, startup, and shutdown using Registry Editor, follow these steps-

  1. Printing Win+R.
  2. Type regedit and hit the Enter push button.
  3. Click the Aye push.
  4. Go to Arrangement in HKLM.
  5. Right-click on Organization > New > DWORD (32-scrap) Value.
  6. Proper noun it as RunUserPSScriptsFirst.
  7. Double-click on it and set up the Value data every bit 1.
  8. Click the OK push button.
  9. Correct-click on System > New > DWORD (32-bit) Value.
  10. Proper name it as RunComputerPSScriptsFirst.
  11. Double-click on it to prepare the Value information equally i.
  12. Click OK to salve the alter.

To know more, keep reading.

Before getting started, it is recommended to fill-in all Registry files and create a Organisation Restore point.

PrintingWin+R to open up the Run prompt, type regedit, and hit theEnterpush button. If the UAC prompt appears, click theYeahpush button. Later that, navigate to this path-

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System

Hither you will have to create 2 REG_DWORD values. For that, correct-click on Arrangement >New > DWORD (32-bit) Value and name it asRunUserPSScriptsFirst.

Run Windows PowerShell scripts first at user logon, logoff, startup, and shutdown

Double-click on it and gear up theValue informationas1.

Run Windows PowerShell scripts first at user logon, logoff, startup, and shutdown

Follow the same steps to create another DWORD (32-scrap) Value and name information technology equallyRunComputerPSScriptsFirst. Then, set up theValue dataevery bit1.

RunUserPSScriptsFirst represents theRun Windows PowerShell scripts get-go at user logon, logoff setting, whereas RunComputerPSScriptsFirst defines theRun Windows PowerShell scripts first at computer startup, shutdown setting.

In instance you want to revert these changes, you can follow these steps.

If yous have done it using the Local Group Policy Editor, open the same path and select theNot Configuredoption. If you lot have washed it using the Registry Editor, open up the sameSystemkey and delete those two REG_DWORD values. To remove them, correct-click on each of them, select theDeleteoption, and ostend it by clicking theOKpush button.

Hope it helps.

Run Windows PowerShell scripts first at user logon, logoff, startup, and shutdown

Source: https://www.thewindowsclub.com/run-windows-powershell-scripts-first

Posted by: raythertualong.blogspot.com

0 Response to "Run Windows PowerShell scripts first at logon, logoff, startup, shutdown"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel