none
Script to rename Windows RRS feed

  • Question

  • Hi,

    Is it possible to rename Windows 8.1 computer without unjoin domain with a powershell script?

    Thanks,

    Thursday, November 14, 2019 9:18 PM

Answers

All replies

  • Hi,

    You can simply use the Rename-Computer PowerShell cmdlet.

    There are also scripts that you can find in the TechNet Gallery for this, do a simple search for "rename computer".

    Best regards,
    Leon


    Blog: https://thesystemcenterblog.com LinkedIn:

    Thursday, November 14, 2019 10:12 PM
  • I use the following

    $ScriptPath = Split-Path -parent $MyInvocation.MyCommand.Definition
    $ScriptPath
    cd $ScriptPath
    # Change this line to reflect the correct user.
    $User='somedomain\someUser'
    $Admin = Get-Credential -credential $User
    Import-Csv '.\OldnameNewname.csv' | ForEach-Object {
            Rename-Computer -NewName $_.'New Name' -Computer $_.'Old Name' -DomainCredential $Admin -LocalCredential $Admin -Restart -Force
            Write-Output "Rename operation completed on" $_
        }

    It uses an Excel CSV file that has the columns named New Name and Old Name.   I originally developed this when our company decided to change naming conventions.  I can rename a single computer or multiple computers simply by lising the computers in the CSV file.

    Tuesday, November 19, 2019 7:05 PM
  • Hi,

    We are getting no such logon session.

    Thanks,

    Tuesday, November 19, 2019 9:57 PM
  • Your CSV file and your script need to be in the same directory.
    Tuesday, November 19, 2019 10:04 PM