I used to have a batch file that changed all of this pretty easily. You just run it, give it the computer name, the user name, and it changes all of the appropriate reg settings. I’m having trouble trying to do this via Powershell.
Here’s what I’ve got now (minus the :
$COMP = read-host -prompt ‘What is the asset tag?’ $DESC = read-host -prompt ‘Who is the owner?’
$Description = Get-WmiObject -class Win32_OperatingSystem -computername $COMP $Description.Description = $DESC $OSValues.put()
$OWNER = Get-WmiObject -class Win32_ComputerSystem -computername $COMP $OWNER.PrimaryOwnerName = $DESC $OWNER.put()
The Organization doesn’t need prompting, just make sure it’s correct…
$REG = “HKLM:SoftwareMicrosoftWindows NTCurrentVersion” ItemProperty -Path $REG -Name “RegisteredOrganization” -Value “ABC Inc”
But this leaves me with this error… Where am I failing? The Description update works, RegisteredOwner and RegisteredOrganization don’t.
submitted by /u/aparis99
[link] [comments]
The post Remotely changing PC’s “Owner”, “Description”, and “Organization”? appeared first on How to Code .NET.