Group Policy - Copy File On First Creation Of User Account

MISAdmin 381 Reputation points
2021-02-25T17:47:19.857+00:00

How can I use Group Policy Preferences to add a file to a user's desktop the first time the user signs in...or when the user account is created? The goal is to not have this file appear on any desktops currently...because it's a file used for configuration and currently all users are configured. It will be used when a user signs on to a PC he/she has never signed on before or when I pull an image down and sign on as the user for the first time.

Windows
Windows
A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.
4,746 questions
{count} votes

6 answers

Sort by: Most helpful
  1. Daisy Zhou 18,701 Reputation points Microsoft Vendor
    2021-02-26T07:46:23.443+00:00

    Hello @MISAdmin ,

    Thank you for posting here.

    We can try the steps below.

    1.You can create an OU and put all the new users into this OU.

    2.Create a GPO named copy file.

    3.Link the GPO to the OU above.

    4.Edit the GPO and navigate to Group Policy Preference under User Configuration > Preferences > Windows Settings > Files >right click file \New\file.

    5.Set the source file location \servername\folder\file.txt.
    Set the destination: C:\Users\%logonuser%\myFolder\file.txt . Any non-existent parent folders in the destination will be created.
    72411-co.png

    6.Then set the preference to Apply once and do not reapply
    72383-co1.png

    7.Sign one domain PC using one account in the OU above to see if it helps.

    Hole the information above is helpful.

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

    Best Regards,
    Daisy Zhou

    0 comments No comments

  2. MISAdmin 381 Reputation points
    2021-02-26T15:15:24.757+00:00

    Hi. Thanks Daisy but this method will not work when an existing users signs on to a different PC for the first time. The existing user will get the file on their current PC also.

    0 comments No comments

  3. Daisy Zhou 18,701 Reputation points Microsoft Vendor
    2021-03-02T08:54:16.26+00:00

    Hello @MISAdmin ,

    Thank you for posting here.

    I have done test in my lab, it works.

    I create a new user (aa1) in OU named test1, this user does not logon any PC.

    I deploy GPO as below.

    73347-new.png

    I logon aa1 to two different PCs for first time, the file ahs been copied successfully.
    73306-new1.png

    Best Regards,
    Daisy Zhou

    0 comments No comments

  4. MISAdmin 381 Reputation points
    2021-03-02T14:26:18.81+00:00

    Hi Daisy. The file will also be copied to that user's current PC...which is what I need to avoid. Some of these users already have PCs. We don't want them to get it on their existing PCs. The file should only be copied the first time a user signs on to Windows. If a user has signed onto a PC in the past, this user should not get the file when they sign on again.

    0 comments No comments

  5. Daisy Zhou 18,701 Reputation points Microsoft Vendor
    2021-03-03T08:21:11.453+00:00

    Hello @MISAdmin ,

    Thank you for your update.

    The user GPO will applied in the following situations:

    1. When the user signs in.
    2. The user has already signed in, and when he/she run gpupdate /force.
    3. The user has already signed in, and the GPO will apply during 90-120 minutes later.

    If you deploy the GPO above and you do not let them to sign in on their existing PCs, the GPO will not apply on their existing PCs.

    Best Regards,
    Daisy Zhou

    0 comments No comments