<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Afetr deploying Unable to join domain using PowerCLI in Automation Tools Discussions</title>
    <link>https://communities.vmware.com/t5/Automation-Tools-Discussions/Afetr-deploying-Unable-to-join-domain-using-PowerCLI/m-p/848589#M376</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you expecting that the server auto joins the domain? I see that you are using a static IP address on the VM. Unfortunately, due to the order in which the customization happens, the static IP address is only applied after a second reboot. To autojoin the domain, you would need to use a DHCP server to make sure the machine already has an IP address at the time the domain join procedure happens.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 Sep 2012 07:24:22 GMT</pubDate>
    <dc:creator>Andr3201110141</dc:creator>
    <dc:date>2012-09-21T07:24:22Z</dc:date>
    <item>
      <title>Afetr deploying Unable to join domain using PowerCLI</title>
      <link>https://communities.vmware.com/t5/Automation-Tools-Discussions/Afetr-deploying-Unable-to-join-domain-using-PowerCLI/m-p/848587#M374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Team,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using the below Script i am able to deploy the VM (OS - Win2k8R2) but its not oining the domain. Could someone assist me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$Domainuser = ""&lt;BR /&gt; $LocalUser = Read-Host "Type Local Admin"&lt;BR /&gt; $LocalPass = Read-Host "Type local Admin Pass" -AsSecureString&lt;BR /&gt;#$getcredential = Get-Credential&lt;BR /&gt;$domainpassword = Read-Host "type domain password" -AsSecureString&lt;BR /&gt;$viserver = Read-Host "Enter VC Name"&lt;BR /&gt; Connect-VIServer $viserver&lt;BR /&gt; &lt;BR /&gt;Import-Csv "C:\PS\newserverdeploy.csv" -UseCulture | %{&lt;BR /&gt;#-----------------------------------------------------------------------------------&lt;BR /&gt; #Create AD Object&lt;BR /&gt; #-----------------------------------------------------------------------------------&lt;BR /&gt; $Server = $_.ServerName&lt;/P&gt;&lt;P&gt;#-----------------------------------------------------------------------------------&lt;BR /&gt; #Create DNS Entry&lt;BR /&gt; #-----------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Remove-OSCustomizationSpec $_.customizationName -Confirm:$false&lt;BR /&gt;&amp;nbsp; $Randomhost = Get-Cluster $_.clustername | Get-VMHost | where {$_.state -notmatch "Maintenance"} | get-random &lt;BR /&gt;$portgroup = $Randomhost | Get-VirtualPortGroup | select name&lt;BR /&gt;$inputportgrp1 = $_.inputportgrp1&lt;BR /&gt;$portgroup | ForEach-Object {if ($_.Name -match $inputportgrp1) {&lt;BR /&gt;$Networkname1 = $_.name &lt;BR /&gt;Write-Host $networkname1&lt;BR /&gt;}}&lt;BR /&gt;$inputportgrp2 = $_.inputportgrp2&lt;BR /&gt;&amp;nbsp; $portgroup | ForEach-Object {if ($_.Name -match $inputportgrp2) {&lt;BR /&gt;$Networkname2 = $_.name &lt;BR /&gt;Write-Host $networkname2&lt;BR /&gt;}}&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt; Get-OSCustomizationSpec $_.customizationname | Set-OSCustomizationSpec -FullName $localuser -AdminPassword $localpass -domain "" -DomainUsername $Domainuser -DomainPassword $domainpassword -AutoLogonCount 2 -Confirm:$false &lt;BR /&gt; &lt;BR /&gt; Get-OSCustomizationSpec $_.customizationname | Get-OSCustomizationNicMapping | where { $_.Position -eq '1'} | Set-OSCustomizationNicMapping -IpMode UseStaticIP -IpAddress $_.ip1 -SubnetMask $_.subnet1 -DefaultGateway $_.Gateway1 -Dns $_.dns1,$_.dns2&lt;BR /&gt; &lt;BR /&gt; New-vm -Name $Server -VMhost $randomhost -Template $_.Template -Datastore $_.Datastore -OSCustomizationspec $_.customization&lt;BR /&gt;Start-Sleep -Seconds 10&lt;BR /&gt;Set-VM $_.Servername -MemoryMB $_.Memory -Confirm:$false&lt;BR /&gt;Start-Sleep 10&lt;BR /&gt;Set-VM $_.Servername -NumCpu $_.CPU -Confirm:$false&lt;/P&gt;&lt;P&gt;Start-VM $_.servername&lt;BR /&gt;Start-Sleep -Seconds 60&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Get-NetworkAdapter -VM $_.ServerName | where {$_.Name -match "1"} | Set-NetworkAdapter -NetworkName $Networkname1 -Connected:$true -StartConnected:$true -Confirm:$false &lt;BR /&gt;Get-NetworkAdapter -VM $_.ServerName | where {$_.Name -match "2"} | Set-NetworkAdapter -NetworkName $Networkname2 -Connected:$true -StartConnected:$true -Confirm:$false&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Start-Sleep -Seconds 30&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2012 19:35:40 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/Automation-Tools-Discussions/Afetr-deploying-Unable-to-join-domain-using-PowerCLI/m-p/848587#M374</guid>
      <dc:creator>Ganapathy</dc:creator>
      <dc:date>2012-05-04T19:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: Afetr deploying Unable to join domain using PowerCLI</title>
      <link>https://communities.vmware.com/t5/Automation-Tools-Discussions/Afetr-deploying-Unable-to-join-domain-using-PowerCLI/m-p/848588#M375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How are you creating the AD object?&amp;nbsp; If by script, then please include AD object creation script.&amp;nbsp; Also please try this for your credentials:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#Embedded credentials to join computer to domain&lt;BR /&gt;$User = "$AdminAccount"&lt;BR /&gt;$Pass = ConvertTo-SecureString "$AdminPassword" -AsPlainText -Force&lt;BR /&gt;$Credentials = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User,$Pass&lt;BR /&gt;$domainuser = $credentials.GetNetworkCredential().UserName&lt;BR /&gt;$domainpassword = $credentials.GetNetworkCredential().Password&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2012 13:23:05 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/Automation-Tools-Discussions/Afetr-deploying-Unable-to-join-domain-using-PowerCLI/m-p/848588#M375</guid>
      <dc:creator>gottr</dc:creator>
      <dc:date>2012-09-18T13:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: Afetr deploying Unable to join domain using PowerCLI</title>
      <link>https://communities.vmware.com/t5/Automation-Tools-Discussions/Afetr-deploying-Unable-to-join-domain-using-PowerCLI/m-p/848589#M376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you expecting that the server auto joins the domain? I see that you are using a static IP address on the VM. Unfortunately, due to the order in which the customization happens, the static IP address is only applied after a second reboot. To autojoin the domain, you would need to use a DHCP server to make sure the machine already has an IP address at the time the domain join procedure happens.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Sep 2012 07:24:22 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/Automation-Tools-Discussions/Afetr-deploying-Unable-to-join-domain-using-PowerCLI/m-p/848589#M376</guid>
      <dc:creator>Andr3201110141</dc:creator>
      <dc:date>2012-09-21T07:24:22Z</dc:date>
    </item>
  </channel>
</rss>

