Skip to content

Instantly share code, notes, and snippets.

@leniency
Created September 23, 2018 04:19
Show Gist options
  • Save leniency/b39740b42edac77fda037b81678de4ad to your computer and use it in GitHub Desktop.
Save leniency/b39740b42edac77fda037b81678de4ad to your computer and use it in GitHub Desktop.
$ResourceLocation = "Global"
$ResourceGroup = "RESOURCE GROUP"
$ResourceName = "DOMAIN NAME"
$PropertiesObject = @{
'Consent' = @{
'AgreementKeys' = @("DNPA","DNTA");
'AgreedBy' = 'IP ADDRESS';
'AgreedAt' = '2017-04-23T04:07:00.0000000Z';
};
'authCode' = 'AUTH CODE';
'Privacy' = 'true';
'autoRenew' = 'true';
}
# May need this first - sometimes the powershell provider isn't loaded.
Register-AzureRmResourceProvider -ProviderNamespace "Microsoft.DomainRegistration"
New-AzResource -ResourceName $ResourceName -Location $ResourceLocation -PropertyObject $PropertiesObject -ResourceGroupName $ResourceGroup -ResourceType Microsoft.DomainRegistration/domains -ApiVersion 2015-02-01 -Verbose
@leniency
Copy link
Author

Powershell script to transfer a domain into Azure.

Original, one modification to add the resource provider.
https://social.msdn.microsoft.com/Forums/azure/en-US/271731d8-6cd2-443b-b861-ee4ee30e34e9/transfer-domain-registration-to-azure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment