Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support logging into a specific tenant (e.g. CSP) and fixed nic… #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions AzureRM - Move existing VM to new Subnet.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
$Error.Clear()

Login-AzureRmAccount
# Add TenantId if you need to log in to a specific tenant by commenting out following two lines
# and using this Login-AzureRmAccount instead of previous login command.
# You will also need to uncomment TenantId in line 47 to include TenantId in Select-AzureRmSubscription.
# $tenantId = ##Specific Tenant Id##
# Login-AzureRmAccount -TenantId $tenantId

# STEP 2 - Select Azure Subscription

Expand All @@ -39,7 +44,7 @@
).SubscriptionId

Select-AzureRmSubscription `
-SubscriptionId $subscriptionId
-SubscriptionId $subscriptionId #-TenantId $tenantId

# STEP 3 - If needed, register ARM core resource providers

Expand Down Expand Up @@ -87,7 +92,7 @@
# STEP 6 - Select new subnet to which VM should be moved

$nicId =
$vm.NetworkInterfaceIDs[0]
$vm.NeworkProfile.NetworkInterfaces[0].Id

$nicName =
(Get-AzureRmResource -ResourceId $nicId).Name
Expand Down