powershell - -JoinDomain parameter not working in Add-AzureProvisioningConfig -


i'm trying create windows vm in azure , join domain in 1 step using azure powershell module. script:

new-azurevmconfig -name $fileserver -label $fileserver -instancesize basic_a3 -imagename $img -hostcaching readwrite -disklabel 'os' -medialocation $medialoc ` | add-azureprovisioningconfig -windowsdomain -joindomain $domjoin -domain $dom -domainusername $domainuser -domainpassword $domainpw -adminusername $adminpassword -password $adminpassword ` | set-azuresubnet 'dynamic1' ` | new-azurevm -servicename $cloudsvcname -vnetname $vnet -verbose -waitforboot 

the error i'm getting follows:

new-azurevm : badrequest: invalid domain join information specified. ensure joindomain setting specified, , either credentials or provisioning setting specified. see windows automated installation kit documentation more information.

if take out these params:

-windowsdomain -joindomain $domjoin -domain $dom -domainusername $domainuser -domainpassword $domainpw -adminusername $adminpassword -password $adminpassword ` 

and replace them these (removing join domain stuff):

-windows -adminusername "localadmin" -password $adminpassword 

i no errors , machine provisions fine without domain joining it.

turns out stupid mistake. had $dom set "mydomain" , $domainuser set "mydomain\user". $domain user should have been "user".


Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -