Archive for category Windows 7

Automating Windows 7 Joining Microsoft Domain With PowerShell Scripts


Automating Windows 7 to join a Microsoft Active Directory Domain

Rename Computer: VBS Script

strComputer = “.”
strNewName = InputBox(“New Computer Name:”)
Set objWMIService = GetObject(“winmgmts:” _
& “{impersonationLevel=impersonate}!\\” & strComputer & “\root\cimv2”)

Set colComputers = objWMIService.ExecQuery _
(“Select * from Win32_ComputerSystem”)

For Each objComputer in colComputers
err = objComputer.Rename(strNewName)

Next

==========================================================

Reboot Batch File: .BAT

shutdown -r -t 1

==========================================================

Add-Computer to Domain: PowerShell Script

Add-Computer -DomainName DomainName.com -cred Domain\Username -PassThru
Restart-Computer

=========================================================

Advertisements

, , , , , , ,

1 Comment