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-
- Printing Win+R.
- Type gpedit.msc and hit the Enter button.
- Go to Scripts in Computer Configuration.
- Double-click on Run Windows PowerShell scripts beginning at user logon, logoff.
- Select the Enabled pick.
- Click Utilize and OK.
- Double-click on Run Windows PowerShell scripts offset at computer startup, shutdown.
- Select the Enabled option.
- 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.
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-
- Printing Win+R.
- Type regedit and hit the Enter push button.
- Click the Aye push.
- Go to Arrangement in HKLM.
- Right-click on Organization > New > DWORD (32-scrap) Value.
- Proper noun it as RunUserPSScriptsFirst.
- Double-click on it and set up the Value data every bit 1.
- Click the OK push button.
- Correct-click on System > New > DWORD (32-bit) Value.
- Proper name it as RunComputerPSScriptsFirst.
- Double-click on it to prepare the Value information equally i.
- 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.
Double-click on it and gear up theValue informationas1.
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.
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