Avatar of iamaidiot
iamaidiot
Flag for United States of America asked on

windows server 2008 r2 environmental variables

Hello,

We have a terminal server that employess logins to use one specific software.  The software requires each individual user to have their own environmental variable value (the actual variable will be the same).  I don't want to have to do it on each individual username manually.  I know i can create a batch file and set environamental variable via setx.  My question is, how would i get setx to set  same variable but different value for each individual user via cmd/batch.  This way I can just add it to gpo and have it run when they login
SoftwareWindows OSWindows Server 2008

Avatar of undefined
Last Comment
iamaidiot

8/22/2022 - Mon
SOLUTION
William Miller

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Lee W, MVP

How does it have to be different? Is it a sequence of numbers?  Or could it just be another name for %username%?

One thought, batch script with a list of the variables and users in a text file.  You can open the text file, find the user name and set the variable to the value next to the user name.
iamaidiot

ASKER
Hey Willian/Lee

variable name will be the same, the variable value can be anything random preferebly combination of lettersandnumbers as long as it is unite from user A to B to C.

Variable Name SSI_BASE (always the same)
Variable Value  abcd1234 (needs to be unique for each user, but can be random combination of letter/number)
ASKER CERTIFIED SOLUTION
Lee W, MVP

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
iamaidiot

ASKER
Hey Lee,

Thank you that is what I went with, I also added milliseconds in front just to make sure it will be even more unique like this  setx SSI_Base %time:~-2%%username%.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes