Here's a quick and easy PowerShell script to set Windows registered owner and organization. The script will automatically set the owner as the logged user.
Tip: Use it during Autopilot deployment so you can have this information automatically added after the assigned user sign-in.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Define registered organization name | |
$strCurrentUserName = $env:UserName | |
$strOrganizationName = "Your Organization Name" | |
$path = 'HKLM:\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion' | |
$key = try { | |
Get-Item -Path $path -ErrorAction STOP | |
} | |
catch { | |
#New-Item -Path $path -Force | |
} | |
New-ItemProperty -Path $key.PSPath -Name RegisteredOwner -Value $strCurrentUserName -Force | |
New-ItemProperty -Path $key.PSPath -Name RegisteredOrganization -Value $strOrganizationName -Force |
No comments:
Post a Comment