If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Rate Thread | Display Modes |
#1
|
|||
|
|||
Script to change user name and machine name on Windows 10
Joe Scotch wrote on 7/20/2017 8:13 PM:
Do you know of a script to periodically change the Windows 10 username & machine name? Some badly behaved programs phone home with the username and machinename so I just want to change them periodically since they're meaningless to me in all ways (they're just xxx and yyy currently, for example). What would be best is a script that changes both randomly upon reboot or manually upon invocation. The actual names don't matter, probably it would be just aaa, bbb, ccc, ddd, eee, fff, ggg, hhh, iii, etc or perhaps a random lookup from a dictionary file but it doesn't matter where the machine name and user names come from since they serve no purpose in my single-user desktop anyway. They're just a privacy hole waiting to be exploited. Do you know of a script to periodically change the Windows 10 username & machine name on demand? Minimally tested PowerShell to set your current username to a random name of 15 characters and to give the computer a random 15 character name. The call to Rename-Computer will restart the computer afterwards. Un-comment the last two lines if you want this script to actually do anything. Must be run as an Administrative user (which is also the account to be renamed). I ran the script on a VM and ended up with a computer name of ict9gjhqianswd and a hostname of ahzpkl99tpk69. If you save the script as something.ps1, to actually run it you'll need to modify the execution policy to allow running unsigned scripts. Use at your own risk. #v+ function Get-CurrentUserAccount { Get-WmiObject -ClassName Win32_UserAccount | Where-Object {$_.Name -like $env:USERNAME} } function Get-RandomName { $alpha = ("abcdefghijklmnopqrstuvwxyz0123456789" -split '' | Where-Object {$_ -ne $null }) $newName = "" for ($i = 0; $i -lt 15; $i++) { $newName += Get-Random -InputObject $alpha } $newName } $NewComputerName = Get-RandomName $userAccount = Get-CurrentUserAccount $NewUserName = Get-RandomName #$userAccount.Rename($NewUserName) #Rename-Computer -NewName $NewComputerName -Restart #v- |
Ads |
Thread Tools | |
Display Modes | Rate This Thread |
|
|