NetRock6
asked on
Powershell - Setting GPO
Hi...
in powershell 5 is there a way to set grop policy to run a user logon script.
I need to setup few logon scripts for serveral PCs.
Thanks.
in powershell 5 is there a way to set grop policy to run a user logon script.
I need to setup few logon scripts for serveral PCs.
Thanks.
Do you mean is there a method to execute a powershell script via group policy?
This link might help you
https://4sysops.com/archives/configuring-logon-powershell-scripts-with-group-policy/
https://4sysops.com/archives/configuring-logon-powershell-scripts-with-group-policy/
You don't typically use PowerShell to configure GPOs. Use the GP Management console for that. That's where you configure which login scripts you want to apply.
If you think about it, it makes sense. Most scripting is about repetitive tasks. A GPO is configured once, and then applied to many users or computers. The GPO cmdlets are good for when you need to repeat the action, but editing a GPO for a specific setting is usually a "one and done" kind of thing.
If you think about it, it makes sense. Most scripting is about repetitive tasks. A GPO is configured once, and then applied to many users or computers. The GPO cmdlets are good for when you need to repeat the action, but editing a GPO for a specific setting is usually a "one and done" kind of thing.
ASKER
Thanks for your comments:
Here more details about how to use Powershell: "grouppolicy" cmdlet
https://technet.microsoft.com/en-us/library/ee461027.aspx?f=255&MSPPError=-2147217396
"One thing" could be repeated over the time ... I have never done "one thing" once.... I needed to repeat it later on too...
Here more details about how to use Powershell: "grouppolicy" cmdlet
https://technet.microsoft.com/en-us/library/ee461027.aspx?f=255&MSPPError=-2147217396
"One thing" could be repeated over the time ... I have never done "one thing" once.... I needed to repeat it later on too...
You can run a PS1 as a logon script or use Powershell to manage GPOs. Which one are you trying to achieve?
ASKER
Managing GPO... That's why the gpo cmdlet for
Thanks
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
As correctly stated by footech, it is not worth it unless you have to do it very often. Whatsoever, you always start with creating the GPO manually via GUI, then export and modify the result if required.