Answered by:
AppV 5.0 SP2 : Is there any command to get the machine name of a client machine

Question
-
Hello All,
Is there any way to retrieve name of the client machine using any command,
like we have "AppVCurrentUserSID" to get the SID of a machine.
I have a small requirement like, we need to copy a registry to a user machine under their computer name.
Any help would be greatly appreciated.
-Raj
Friday, April 18, 2014 3:41 PM
Answers
-
The App-V 5 sequencing guide does list a token for the computer name, [{AppVComputerName}]. I have not used it though. The guide was written for App-V 5.0, I don't know if anything is outdated.
Sequencing Guidesnippet;
Windows
C:\windows
Custom Token
Custom Token Expansion
AppVAllUsersDir
C:\Users\All Users
AppVComputerName
<USERNAME>-LT02
AppVCurrentUserSID
S-1-5-21-124525095-708259637-1543119021-705252
AppVEnvironmentVariableCommonProgramFiles
%commonprogramfiles%
AppVEnvironmentVariableProgramFiles
%ProgramFiles%
AppVPackageDrive
C:
AppVPackageRoot
C:\AppInstallFolder
AppVSystem32Catroot
C:\windows\system32\catroot
AppVSystem32Catroot2
C:\windows\system32\catroot2
AppVSystem32DriversEtc
C:\windows\system32\drivers\etc
AppVSystem32Driverstore
C:\windows\system32\driverstore
AppVSystem32Logfiles
C:\windows\system32\logfiles
AppVSystem32Spool
C:\windows\system32\spool
If anyone has experience with the Custom Token I'd be very interested to hear more.
- Marked as answer by learner_cr Monday, April 28, 2014 11:24 AM
Tuesday, April 22, 2014 1:46 PM -
Here you can read how to use the tokens/variables in the Deployment or User Config files.
It also has an example how to use the Hostname/Computername in the registry.
- Proposed as answer by znack Wednesday, April 23, 2014 7:22 AM
- Marked as answer by learner_cr Monday, April 28, 2014 11:24 AM
Wednesday, April 23, 2014 6:42 AM
All replies
-
Hi learner_cr,
You can use the hostname command with powershell or cmd.
Friday, April 18, 2014 4:26 PM -
yea, we could use hostname in command,
I have doubt in how to use it in our xml file
for example if the deployment config's virtual registry is like this
Software\Appname\Test\1.0\"Hostname"\AnotherKey]
if we are directly giving hostname in config file, it fails, for this is there any other way.
Thanks!
Saturday, April 19, 2014 5:24 AM -
Use a script for that (batch, vbscript, powershell).
Within a script you can use %hostname% for example in a batch script.
- Proposed as answer by znack Tuesday, April 22, 2014 10:44 AM
Tuesday, April 22, 2014 7:05 AM -
The App-V 5 sequencing guide does list a token for the computer name, [{AppVComputerName}]. I have not used it though. The guide was written for App-V 5.0, I don't know if anything is outdated.
Sequencing Guidesnippet;
Windows
C:\windows
Custom Token
Custom Token Expansion
AppVAllUsersDir
C:\Users\All Users
AppVComputerName
<USERNAME>-LT02
AppVCurrentUserSID
S-1-5-21-124525095-708259637-1543119021-705252
AppVEnvironmentVariableCommonProgramFiles
%commonprogramfiles%
AppVEnvironmentVariableProgramFiles
%ProgramFiles%
AppVPackageDrive
C:
AppVPackageRoot
C:\AppInstallFolder
AppVSystem32Catroot
C:\windows\system32\catroot
AppVSystem32Catroot2
C:\windows\system32\catroot2
AppVSystem32DriversEtc
C:\windows\system32\drivers\etc
AppVSystem32Driverstore
C:\windows\system32\driverstore
AppVSystem32Logfiles
C:\windows\system32\logfiles
AppVSystem32Spool
C:\windows\system32\spool
If anyone has experience with the Custom Token I'd be very interested to hear more.
- Marked as answer by learner_cr Monday, April 28, 2014 11:24 AM
Tuesday, April 22, 2014 1:46 PM -
Here you can read how to use the tokens/variables in the Deployment or User Config files.
It also has an example how to use the Hostname/Computername in the registry.
- Proposed as answer by znack Wednesday, April 23, 2014 7:22 AM
- Marked as answer by learner_cr Monday, April 28, 2014 11:24 AM
Wednesday, April 23, 2014 6:42 AM -
Yea, I too found this aft some time. Thank U
Monday, April 28, 2014 11:19 AM -
That link was so accurate. Thanks!
AppVComputerName plays.
Monday, April 28, 2014 11:20 AM