This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get administration certificate. | |
# Get-AzurePublishSettingsFile | |
# Import-AzurePublishSettingsFile -PublishSettingsFile "C:\Users\pkirch\Downloads\Azure MSDN - pkirchner-9-11-2014-credentials.publishsettings" | |
# Settings | |
$SubscriptionName = "Azure MSDN - pkirchner" | |
$StorageAccountName = "pkmsft" | |
$Container = "vhds" | |
$LocalVhd = "C:\Users\pkirch\fixedvhd20mb.vhd" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-AzureVM | Get-AzureEndpoint | |
<# Output | |
LBSetName : | |
LocalPort : 5986 | |
Name : PowerShell | |
Port : 5986 | |
Protocol : tcp | |
Vip : 104.40.188.19 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-AzureVM | Get-AzureEndpoint | Select-Object -Property Vip, Name, Port, LocalPort | Format-Table -AutoSize | |
<# Output | |
Vip Name Port LocalPort | |
--- ---- ---- --------- | |
104.40.188.19 PowerShell 5986 5986 | |
104.40.188.19 Remote Desktop 56595 3389 | |
191.233.81.126 PowerShell 5986 5986 | |
191.233.81.126 Remote Desktop 61942 3389 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get all Azure VMs in the current subscription. | |
Get-AzureVM | ForEach-Object { | |
# Save the current VM for use in the nested ForEach. | |
$vm = $_ | |
# Get all endpoints of the current VM. | |
$endpoints = Get-AzureEndpoint -VM $vm | |
# Iterate all endpoints of the current VM. | |
$output = $endpoints | ForEach-Object { | |
# Create our own set of properties we want for output. | |
$hashtable = @{ServiceName=$vm.ServiceName; InstanceName=$vm.InstanceName; DNSName=$vm.DNSName; Protocol=$_.Name; Vip=$_.Vip; ExternalPort=$_.Port; InternalPort=$_.LocalPort} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-Command -Module Azure | Where-Object {$_.Parameters.Keys -contains "Label"} | |
<# Output | |
CommandType Name ModuleName | |
----------- ---- ---------- | |
Cmdlet Add-AzureDisk Azure | |
Cmdlet Add-AzureVMImage Azure | |
Cmdlet New-AzureAffinityGroup Azure | |
Cmdlet New-AzureDeployment Azure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-Command -Module Azure | Where-Object {$_.Parameters.Keys -contains "Description"} | |
<# Output | |
CommandType Name ModuleName | |
----------- ---- ---------- | |
Cmdlet Add-AzureVMImage Azure | |
Cmdlet New-AzureAffinityGroup Azure | |
Cmdlet New-AzureAutomationRunbook Azure | |
Cmdlet New-AzureAutomationSchedule Azure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set-AzureService -ServiceName leasetest2 -Description "This cloud service contains all frontend VMs, which are grouped into two availabilty groups." -Label "Frontend West EU" | |
<# Output | |
OperationDescription OperationId OperationStatus | |
-------------------- ----------- --------------- | |
Set-AzureService 54a6c394-f6d5-5d14-9496-ddaa1ad9076c Succeeded | |
#> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sample by Peter Kirchner (peter.kirchner@microsoft.com) | |
# Settings | |
$subscriptionName = "MSFT MVA Live" # Get-AzureSubscription | |
$location = "West Europe" # Get-AzureLocation | |
$serviceName = "pktestservice" | |
$storageAccountName = "pkteststorage" | |
$storageContainerName = "vhds" | |
$adminUsername = "adm_test" | |
$adminPassword = "Azureisttoll!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sample 1 | |
Get-AzureVM | Get-AzureEndpoint | |
# sample 2 | |
Get-AzureVM | Get-AzureEndpoint | Select-Object -Property Vip, Name, Port, LocalPort | Format-Table -AutoSize | |
# sample 3 | |
Get-AzureVM | ForEach-Object { | |
# Save the current VM for use in the nested ForEach. | |
$vm = $_ |
OlderNewer