Best method to add path through GPO and update it when it changes

I push out Java through a GPO and having a heck of a time with Java 8 and it not adding the path to the path variable. I am adding a GPO to add the Java path and that is working fine. I am concerned when Java updates that I am going to need to update the path from c:\Program Files (x86)\Java\jre1.8.0_40\bin\ to whatever the latest version will be.

I have the GPO doing a 'Create' action. What should I do when that path is no longer valid? Do an update? A replace?

Or maybe there is a different way to approach this?
LVL 2
mvalpredaAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

awawadaCommented:
The Create action creates a preference if there isn’t one already. For example, you can use the Create action to create and set the value of a user environment variable called CurrentOrg. If the variable already exists, the variable value won’t be changed.

The Replace action also creates preferences that don’t yet exist, or deletes and creates preferences that do already exist. For example, you can use the Replace action to replace a file on certain computers. If the file exists, Group Policy removes it from the target location, copies it from a specified source location and overwrites the existing file in a designated target location. If the file doesn’t exist, Group Policy simply copies it from the source location to the designated target location.

The Update action creates preferences that don’t yet exist or modifies preferences if they do exist. For example, you can use the Update action to modify a local group. If the local group exists, you can rename the group and update its settings with the settings you’ve defined for the preference item.

Source:
https://technet.microsoft.com/en-us/magazine/hh848751.aspx
http://blogs.msdn.com/b/microsoft_press/archive/2009/09/29/william-stanek-applying-group-policy-preferences-with-crud.aspx

You can use one or the other depending on your needs. We always use Update.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mvalpredaAuthor Commented:
Can you tell me about your application? Are you doing something similar with a program that changes path?
0
awawadaCommented:
We use it also to add path's, map network drive, Printers or other tasks for our customers on more than 20'000 clients.
0
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

mvalpredaAuthor Commented:
So you are not changing that path once applied?
0
awawadaCommented:
We have to change a path (like software, network drive etc.) manytimes.
0
mvalpredaAuthor Commented:
Are you changing an existing GPO with a different path? I plan on updating the same GPO over and over.
0
mvalpredaAuthor Commented:
I added this GPO and the path keeps getting added over and over. I see c:\Program Files (x86)\Java\jre1.8.0_45\bin in the path statement on the machine about 50 times.

How do I need to set the path properties under Common?
I had "Remove this item when it is no longer applied" checked and have now unchecked it. I now have "Apply once and do not reapply" checked, but I don't know if that is going to allow me to update the path when I need to change it.

EDIT
Once I checked "Apply once and do not reapply" any changes do not show up on the path. There must be a different way to do this so the path doesn't keep growing and that I can change this. I think I might need to do an add for the current, then when that changes do a delete, and add the new path with a new line.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Active Directory

From novice to tech pro — start learning today.