How to execute logon and logoff scripts using Group Policy Objects (GPO) - Active Directory (AD)

preview_player
Показать описание
Demonstration on how you can create and enforce logon and logoff scripts for clients connected to Windows Server 2022 using Group Policy Objects (GPO). This allow Administrators to push scripts across multiple clients based on their relationships to Organizational Units (OU) with Active Directory (AD).

Force loading GPOs to clients:
gpupdate /force

This demonstration uses Windows Server 2022 server with Windows 10 and Windows 11 Professional clients. But the principles are same for Windows Server 2012 through 2022 (Windows Server 2022 / 2019 / 2016 / 2012). There are no GUI differences among most of the pervious versions of Windows Servers. The enforced GPO settings will work on Windows 11, 10 and previous versions of client Operating Systems connected to the domain Active Directory.

-Windows Server Admin playlist:
-Microsoft Windows playlist:

Track: WhileART Sessions Episode 02 | Waramathi (වරමාතී) Fusion

Co-producer:
Manuja Senanayake

#windowsserver2022 #AD #GPO #powershell #powershell7
Рекомендации по теме
Комментарии
Автор

Good job, I'm working on something similar, I'm trying to add keyboard layouts for all users (French \Arabic) for exemple, the poilcy work fine with the powershell scripts but when I added it to mdt deployment it doesn't work, is there any other options to do it, thanks

timecop
Автор

Okay this may be the reason why my O365 isn't executing.. Login script wasn't set into that directory. It was in the same shared folder as the O365 setup.exe.

GabrielMontenegro-kn
Автор

What happens if you point the GPO to a script in a different location rather than the folder where you are pasting the script?

DaniLearnsIT
Автор

Sir when user login lan card enabled and when logoff user land disable how to set up it

N.raju
Автор

sir... i need help plz.... i need to run these commands on each pc/laptop on the network. so better to create a script for them all and deploy via gpo. so how to do it?

- disconnect all mapped folders/drives
- ipconfig /flushdns
- ipconfig /release
- ipconfig /renew
- gpupdate /force
- restart pc

أكلاتلذيذه-زت
Автор

Does it works to windows server 2008 r2?

thushanbasnayaka
Автор

CAn it be done on command, without the users having to logoff and login again?

waffleMccoy
Автор

What if you need to run PowerShell in administrator mode?

stephenvernon