/build/static/layout/Breadcrumb_cap_w.png

Kace Script to Add a Registry Entry with the Computer Name

I'm trying to create a script that will add a registry entry with the computer name:

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\WebExSilentInstaller]
"Name"="ExampleComputerName"

Where "ExampleComputerName" is the computer name.

I need to create this entry on every computer within Kace and need to replace the "ExampleComputerName" with the current computer name.

Is this possible?


0 Comments   [ + ] Show comments

Answers (1)

Posted by: scottcopus 4 years ago
Senior Yellow Belt
1

via cmd/batch:

reg.exe add "HKLM\SOFTWARE\WOW6432Node\WebExSilentInstaller" /v "Name" /t REG_SZ /d "%COMPUTERNAME%" /f


via PowerShell:

$regPath = "HKLM:\SOFTWARE\WOW6432Node\WebExSilentInstaller"
New-Item -Path $regPath -ErrorAction SilentlyContinue | Out-Null
New-ItemProperty -Path $regPath -Name "Name" -Value "$env:COMPUTERNAME" -PropertyType String -Force | Out-Null


cheers,

Scott


Comments:
  • Scott, you are awesome! That worked like charm! - mcclainr@tessco.com 4 years ago
  • So it worked on my computer when updating the registry but when I run the script for another computer in the Kace inventory it adds MY computer name into the registry.

    Is there a Kace variable that I can use for the computer I'm adding the registry entries too? - mcclainr@tessco.com 4 years ago
    • Have you confirmed that your computer's name is on those remote computers' registries by manually checking them? Run the scripts locally on a couple other boxes and see if they work there. - scottcopus 4 years ago
      • We are in the process of upgrading from Kace 8 to Kace 10. I created the script on the Kace 10 server and it works perfect with a few test computers that I have on there. It was when I exported/imported into the Kace 8 server that it didn't seem to work. I will wait until everyone is on the new server to install the software. Thanks for your help! - mcclainr@tessco.com 4 years ago

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ