Ok, that makes more sense. In that case I needed to take advantage of WMI. My final code is this, which works great! $temp = Get-WmiObject -Class Win32_ComputerSystem | Select-Object -ExpandProperty username $UserName = $temp -replace ".*\\", "" Set-ItemProperty -Path "HKLM:\Software\MMSOFT Design\PC Monitor\" -Name ComputerName -Value "$UserName" Thanks for the help!