Skip to main content
Best answer by STEVEG

In the startup batch file for Creo I have for everyone I put some lines in to find them and record them.

There is a file (something like Creo_Parametric_2_0_M150.xxxxxxxxxxxxxx.xml) that has it.  It is located in <usersprofile>\AppData\Local\PTC\QualityAgent\UnprocessedFiles.

My batch file looks at this file and searches for the line with "User_ID" and "UUID".  The it outputs it to a text file for me.

4 replies

1-Visitor
July 22, 2015

The idea is to mask the users in a way there is no possibility to conclude back to them.

Hence, the only place where the ID is related to the user, is on the user machine, where it is visible in the PTC Diagnostic Tool (User ID in the application tabs).

Currently for an administrator (or any other legitimate person) to identify users, the users will have to send their UUIDs, so they can be collected.

corrected: UUID on the bottom of System Info is the masked machine ID - User ID, the masked user, is in the header of the application tabs

STEVEG21-Topaz IAnswer
21-Topaz I
July 24, 2015

In the startup batch file for Creo I have for everyone I put some lines in to find them and record them.

There is a file (something like Creo_Parametric_2_0_M150.xxxxxxxxxxxxxx.xml) that has it.  It is located in <usersprofile>\AppData\Local\PTC\QualityAgent\UnprocessedFiles.

My batch file looks at this file and searches for the line with "User_ID" and "UUID".  The it outputs it to a text file for me.

JamesAvis14-AlexandriteAuthor
14-Alexandrite
July 27, 2015

That'll do it, thanks!

21-Topaz I
August 18, 2015

This may not be the most elegant way to do it but it's work flawlessly so far for me.

cd C:\Users

:: I have a few users that the name of the profile is <username>.<domain name> instead of just <username>

:: So I search for the domain name profile first.

if exist C:\Users\%username%.<domain name>\AppData\Local\PTC\QualityAgent\SentFiles (

set NUP=%username%.<domain name>

goto _IDS

)

if exist C:\Users\%username%\AppData\Local\PTC\QualityAgent\SentFiles (

set NUP=%username%

goto _IDS

)

goto SC

:_IDS

if exist C:\Users\%NUP%\AppData\Local\PTC\QualityAgent\SentFiles (

if exist C:\Users\%NUP%\AppData\Local\PTC\QualityAgent\UnprocessedFiles (

cd C:\Users\%NUP%\AppData\Local\PTC\QualityAgent\UnprocessedFiles

))

for /F %%a in ('dir /B Creo_Parametric*') do set CP=%%a

if not defined CP goto SC

for /F "tokens=1-3 delims=<> " %%b in (%CP%) do (

if %%b==User_ID (

set UID=%%c

))

if not defined UID goto SC

for /F "tokens=1-3 delims=<> " %%i in (%CP%) do (

if %%i==UUID (

set CID=%%j

))

:: This section is to check if the info is already recorded.  If so then skip it.

for /F "tokens=1-3 delims=, " %%a in (<network loc>\_PA_IDs.txt) do (

if /I %%a==%username% (

if /I %%c==%computername% (

goto SC

)))

echo %username%, %UID%, %computername%, %CID% >> <network loc>\_PA_IDs.txt

:SC

Continue with batch file.

17-Peridot
August 19, 2015

Awesome!  Thanks so much!

21-Topaz I
October 16, 2015

*** Update ***

I have had to revise the batch file slightly.

The problem is it seems the UID and UUID value has changed from M150 to M170 for each user and computer.  So instead of this:

for /F "tokens=1-3 delims=, " %%a in (<network loc>\_PA_IDs.txt) do (

if /I %%a==%username% (

if /I %%c==%computername% (

goto SC

)))

I now have this:

for /F "tokens=1-4 delims=, " %%a in (<network loc>\_PA_IDs.txt) do (

if /I %%b==%UID% (

if /I %%d==%CID% (

goto SC

)))

The changes are highlighted in red.  Everything else is the same.

The way it was before was searching for and comparing the username and computername.  So when the UID and UUID changed it wouldn't record the new values since the username and computername are the same.

11-Garnet
January 13, 2023

Hi

This is an old article, but we have used it for a while with great success. I added "wmic csproduct get name" in our version so we also got the type of machine for each user. That also worked fine until Windows 11 arrived...

 

So, for any interested I have rewritten the script into Powershell instead. As it's my first attempt, it works, but anyone out there can probably improve it.

Here it is (I call it "get_uuid.ps1")

 

# Script to rip out UUID from Creo and send it to a text file. Based on the script below.
# https://community.ptc.com/t5/Performance-Advisor/How-to-identify-a-user-in-Performance-Advisor/m-p/382262#M179%3F&art_lang=en&posno=2&q=collect%20UUID&source=search
# 221230 Converted to Powershell
# 230104 Added OS version

# Set file where to put the result
$NETWORK_LOC='\\file_server\uuids.txt'

# Change to location where thee PTC Diagnostic tool is
cd $env:localappdata\PTC\QualityAgent\SentFiles

# Change the versions below at update
if (Test-Path -Path PTC_Creo_Parametric_7_0_7080.xml){
$CP='PTC_Creo_Parametric_7_0_7080.xml'}
if (Test-Path -Path PTC_Creo_Parametric_7_0_7090.xml){
$CP='PTC_Creo_Parametric_7_0_7090.xml'}
if (Test-Path -Path PTC_Creo_Parametric_9_0_9020.xml){
$CP='PTC_Creo_Parametric_9_0_9020.xml'}

$File = Get-ChildItem -Path $CP
# Search for the User id.
$String = ($File | Select-String -Pattern 'User_ID')
$a,$b,$c,$d = $String -split '[<>]'
$UID = $c
# Search for the Computer id.
$String2 = ($File | Select-String -Pattern 'UUID')
$e,$f,$g,$h = $String2 -split '[<>]'
$CID = $g

#Find OS version
$String3 = (get-wmiobject Win32_Operatingsystem | select Caption).Caption
$i,$j,$k,$l = $String3 -split '[" "]'
$os_version = -join($j, " ", $k)

# Search for the type of computer.
$computer_name = (Get-CimInstance -ClassName Win32_ComputerSystem -Property Model).Name
$machine_type = (Get-CimInstance -ClassName Win32_ComputerSystem -Property Model).Model

# This section is to check if the info is already recorded. If so then skip it.
$Matches = 'X'
Get-Content $NETWORK_LOC | Where-Object { $_ -match $UID } | Where-Object { $_ -match $CID} | ForEach-Object {$Matches[1]}
if ($Matches -eq 'X'){
	# Finally submit the user and computer data to remote location.
	"$env:username,$UID,$CID,$computer_name,$machine_type,$os_version" | out-file -filepath $NETWORK_LOC -append -Encoding ASCII -Width 200
}

# The End is here

 As a bonus I added the Windows version too in the output.

21-Topaz I
January 17, 2023

What kind of information can you not get in Windows 11 now?