search
Categories
Sponsors
VirtualMetric Hyper-V Monitoring, Hyper-V Reporting
Archive
Blogroll

Badges
MCSE
Community

Cozumpark Bilisim Portali
System Center Virtual Machine Manager 2012 SP1 PowerShell Tasks – Part 1
Posted in Virtual Machine Manager, Windows Powershell | No Comment | 5,910 views | 12/10/2012 11:55

1. How to create RunAs Account?

1
2
3
$SecurePassword = ConvertTo-SecureString "P@ssw0rd!" -AsPlainText -Force
$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "yusufozturk\Administrator", $SecurePassword
New-SCRunAsAccount -Name "Domain Admin" -Credential $Credential

2. How to get RunAs Account?

1
Get-SCRunAsAccount -Name "Domain Admin"

3. How to remove RunAs Account?

1
Get-SCRunAsAccount -Name "Domain Admin" | Remove-SCRunAsAccount

4. How to get Host Group?

1
Get-SCVMHostGroup -Name "All Hosts"

5. How to create Host Group?

1
New-SCVMHostGroup -Name "New Host Group" -ParentHostGroup "All Hosts"

6. How to remove Host Group?

1
Get-SCVMHostGroup -Name "New Host Group" | Remove-SCVMHostGroup

7. How to add a Cluster to Host Group?

1
2
3
$RunAsAccount = Get-SCRunAsAccount -Name "Domain Admin"
$HostGroup = Get-SCVMHostGroup -Name "New Host Group"
Add-SCVMHostCluster -Name "cluster.yusufozturk.info" -VMHostGroup $HostGroup -Credential $RunAsAccount -RemoteConnectEnabled $true -RunAsynchronously

Next parts, I’ll add how to create cloud, logical switches etc.



Leave a Reply