Rename & join a computer into a domain within a single powershell command

This command renames the local computer to and then restarts automatically.

In my Test environment the command would be  alike:

Rename-Computer -NewName “w2016DC2” -DomainCredential test.test\administrator -Restart

which translates into:

Rename-Computer -NewName “desired_name” -DomainCredential “domain\username”-Restart

Modify the following parameters:

 “w2016DC2” (your desired computer name)

test.test\administrator ( AD account needed )

Domain admin credentials or either an account with the sufficient permissions-delegation.

This will be displayed once done, following a computer restart.

2018-01-09 20_30_03-W2016DC2 on 2016CORE - Virtual Machine Connection.png

once the credentials are introduced, will be in our domain after the restart.

2018-01-09 20_34_15-W2016DC1 on 2016CORE - Virtual Machine Connection.png

All of the parameter inputs

Rename-Computer
[-ComputerName ]
[-PassThru]
[-DomainCredential ]
[-LocalCredential ]
[-NewName]
[-Force]
[-Restart]
[-WsmanAuthentication ]
[-Protocol ]
[-WhatIf]
[-Confirm]
[]

a quick reference TechNet guide

https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/rename-computer?view=powershell-5.1

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s