• Status: Solved
  • Priority: High
  • Security: Public
  • Views: 81
  • Last Modified:

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
0
iamaidiot
Asked:
iamaidiot
  • 2
  • 2
2 Solutions
 
William MillerInventory/IT ConsultantCommented:
When you say a different value, is it a specific value the software requires or does it simply need to be different from User A to B to C?
0
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
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.
0
 
iamaidiotAuthor Commented:
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)
0
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
So why not just make it the username?  SET SSI_BASE=%username% - it will always be unique to the user.
0
 
iamaidiotAuthor Commented:
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%.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now