header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
rename computer and join domain - need some help
Last Post 02 Sep 2010 02:49 AM by travelfreak. 0 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages Not Resolved
travelfreakUser is Offline
New Member
New Member
Posts:1
Avatar

--
02 Sep 2010 02:49 AM
    Hi all,

    just starting with powershell and need some help with the following. After installation of windows
    and autologon a window pops up to ask the new computer name and new domain name.

    I startet like this:

    [void][System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic') $name = [Microsoft.VisualBasic.Interaction]::InputBox("Bitte neuen Computernamen eingeben:", "Name", "$env:username") $oComputerSystem = Get-WmiObject win32_computersystem $oComputerSystem.Rename( "$name" )

    then reboot, autologon and runonce again to join the domain like

    add-computer -domain dom1.test -OUPath "OU=computers,DC=dom1,DC=test" -cred $credential

    Here my questions:
    - whats the best way when i input the domain to save it into a variable to have it after the reboot
    - how can use the credentials to automate the join domain (with a manual input during the command)
    - i assume its not possible without a reboot during rename and domain joining

    Anyone can help me with some code oder samples?

    cheers,
    Marco
    You are not authorized to post a reply.


    Active Forums 4.3
    right
    footer   footer
    footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
    footer   footer