During migrations there is always the trouble of all those settings and things to do before everything is running smoothly.
Well during my migration I needed to move several Machines to a private cloud subscription in Azure Pack.
As I’m not the Biggest Powershell Guru I like to keep things simple and I’m a big fan of the “ select Name “ and the “ Out-GridView “
Options these options give you much more detail and make powershell a but more GUI ( don’t shoot )
#Set your SCVMM server and use -ForOnBehalfOf to make use of Service Provider Foundation.
Import-Module -Name virtualmachinemanager
$VMMSERVER = Get-SCVMMServer -ComputerName YOUR OWN VMM Server-ForOnBehalfOf
#Select WAP Cloud
$Cloud = Get-SCCloud -Name (Get-SCCloud | select Name | Out-GridView -Title "Select WAP Cloud" -PassThru).Name
#Select Select WAP User Subscription
$User = (Get-SCUserRole | Where-Object Cloud -Match $Cloud).Name | Out-GridView -PassThru -Title "Select WAP User Subscription"
# Show WAP Subscription User
$WAPUserrole = Get-SCUserRole | Where-Object Cloud -Match $Cloud | Where-Object Name -Like $User*
$WAPUserrole |ft name
# Select Single VM to WAP
$WAPVM = (Get-SCVirtualMachine ($Cloud | Get-SCVirtualMachine | select Name | Out-GridView -Title "Select Single VM to WAP" -PassThru).Name)
# show Selected VM to WAP Subscription
#Place VM in WAP Subscription
Set-SCVirtualMachine -VM $WAPVM –UserRole $WAPUserrole –Owner $User
As there is a pick list there is no typo there when moving the VM
When Checking the Windows Azure Portal you will see after a refresh a VM that is migrated to Azure Pack.
Author: Robert Smit [MVP]
Robert Smit is Senior Technical Evangelist and is a current Microsoft MVP in Clustering as of 2009.
Robert has over 20 years experience in IT with experience in the educational, health-care and finance industries.
Robert’s past IT experience in the trenches of IT gives him the knowledge and insight that allows him to communicate effectively with IT professionals
who are trying to address real concerns around business continuity, disaster recovery and regulatory compliance issues. Robert holds the following certifications:
MCT - Microsoft Certified Trainer, MCTS - Windows Server Virtualization, MCSE, MCSA and MCPS. He is an active participant in the Microsoft newsgroup community and is currently focused on Hyper-V, Failover Clustering, SQL Server, Azure and all things related to Cloud Computing and Infrastructure Optimalization.
Follow Robert on Twitter @ClusterMVP
Or follow his blog https://robertsmit.wordpress.com
Linkedin Profile Http://nl.linkedin.com/in/robertsmit
Robert is also capable of transferring his knowledge to others which is a rare feature in the field of IT. He makes a point of not only solving issues but also of giving on the job training of his colleagues.
A customer says " Robert has been a big influence on our technical staff and I have to come to know him as a brilliant specialist concerning Microsoft Products. He was Capable with his in-depth knowledge of Microsoft products to troubleshoot problems and develop our infrastructure to a higher level. I would certainly hire him again in the future. "
Details of the Recommendation: "I have been coordinating with Robert implementing a very complex system. Although he was primarily a Microsoft infrastructure specialist; he was able to understand and debug .Net based complext Windows applications and websites. His input to improve performance of applications proved very helpful for the success of our project
View all posts by Robert Smit [MVP]
3 thoughts on “PowerShell Place custom VM into Windows Azure Pack Subscription #wapack #cloud #scvmm #Microsoft”
Great article. Thank you.
Thanks for reading my Blog
Nice script. Thanks.