RUN a command line or Power Shell script using logon on windows machine

PerserPolis-1732 1,971 Reputation points
2024-01-22T14:33:30.78+00:00

Hi, I wanna to a command line for example C:\ipconfig /flushdns every time if the user want to login on Windows client, but the user do should not see it during login on Client machine. As I know,I can do that with GPO or logon script for every user Any Idea how I can do that? Regards

Windows for business Windows Server User experience Other
Windows for business Windows Client for IT Pros User experience Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Anonymous
    2024-01-23T02:23:57.9566667+00:00

    Hello PerserPolis-1732,

    Thank you for posting in Q&A forum.

    I assume you have one domain, then we can follow the steps below:

    1.Create one OU on Domain Controller.
    2.Put the user accounts that need to run this command line or Power Shell script to this OU. 3.Create one GPO and rename this GPO.

    For example:

    I rename this GPO (GPO name is tt1 and its GUID is {5EE96627-35BD-434C-9C6A-4AE328E7D13A}). User's image

    4.Put the this command line or Power Shell script file to this folder below: \domain.com\SYSVOL\domain.com\Policies{5EE96627-35BD-434C-9C6A-4AE328E7D13A}\User\Scripts\Logon 5.Edit this GPO as below.
    User's image

    User's image

    6.If the specific users logon, then this user will apply the logon GPO.

    I hope the information above is helpful.

    If you have any question or concern, please feel free to let us know.

    Best Regards,
    Daisy Zhou



    If the Answer is helpful, please click "Accept Answer" and upvote it.


  2. PerserPolis-1732 1,971 Reputation points
    2024-01-30T11:08:40.74+00:00

    ????????????????????

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.