際際滷

際際滷Share a Scribd company logo
Better Together: Microsoft Azure Virtual Machines & PowerShell Desired State Configuration
Better Together: Microsoft Azure Virtual Machines & PowerShell Desired State Configuration
Better Together: Microsoft Azure Virtual Machines & PowerShell Desired State Configuration
Better Together: Microsoft Azure Virtual Machines & PowerShell Desired State Configuration
Better Together: Microsoft Azure Virtual Machines & PowerShell Desired State Configuration
$featureName = "telnet-client" 
$result = Get-WindowsFeature $featurename 
if ($result.InstallState -eq "Installed") 
{ 
Write-host "$featureName already installed" 
} 
else 
{ 
Write-host "$featureName is not installed, going to install it" 
Install-WindowsFeature $featureName 
}
Better Together: Microsoft Azure Virtual Machines & PowerShell Desired State Configuration
$node = "localhost" 
Configuration SecondDimension 
{ 
node $node 
{ 
WindowsFeature TelnetClient 
{ 
Ensure = "Present" 
Name = "telnet-client" 
} 
} 
} 
SecondDimension 
Start-DscConfiguration -Wait -Verbose -Path .SecondDimension -force
Better Together: Microsoft Azure Virtual Machines & PowerShell Desired State Configuration
Better Together: Microsoft Azure Virtual Machines & PowerShell Desired State Configuration
Better Together: Microsoft Azure Virtual Machines & PowerShell Desired State Configuration
Better Together: Microsoft Azure Virtual Machines & PowerShell Desired State Configuration
$subscriptionname = '仍舒仂仄 MSDN' 
$storageaccountname = 'dimensionsstg' 
$configurationpath = 'C:DimensionsDimensions.ps1' 
$vmname = 'Dimensions-SP1' 
$servicename = 'dimensions' 
$configurationarchive = 'Dimensions.ps1.zip' 
$configurationname = 'Dimensions' 
#Select subscription 
Select-AzureSubscription $subscriptionname 
#Select storage account where DSC configuration will be stored 
Set-AzureSubscription $subscriptionname -CurrentStorageAccountName $storageaccountname 
#Upload configuration into the storage account. 
Publish-AzureVMDscConfiguration -ConfigurationPath $configurationpath -Force 
#Apply DSC configuration to the $vmname 
$vmtoupdate = Get-AzureVM -Name $vmname -ServiceName $servicename 
$vmtoupdate = Set-AzureVMDSCExtension -VM $vmtoupdate ` 
ConfigurationArchive $configurationarchive -ConfigurationName $configurationname 
$vmtoupdate | Update-AzureVM
Better Together: Microsoft Azure Virtual Machines & PowerShell Desired State Configuration
Configuration Dimensions 
{ 
Import-DscResource -ModuleName xSharepoint2010SP2 
node 'localhost' 
{ 
xSharepoint2010SP2 Install 
{ 
Ensure = 'Present' 
Key = ABCDE-FGHIJ-KLMNO-PQRST-12345' 
DownloadLink = 'https://enterurl.com/en_sharepoint_server_2010.iso' 
MD5FileHash = '16B6B4781336659A28898120F8EA603D' 
TempFolder = 'C:Install' 
} 
} 
}
 
http://www.slideshare.net/jallspaw/10-deploys-per-day-dev-and-ops-cooperation- 
at-flickr 
 
http://blogs.technet.com/b/privatecloud/archive/2013/08/30/introducing-powershell- 
desired-state-configuration-dsc.aspx 
 
http://blogs.msdn.com/b/powershell/archive/2014/08/07/introducing-the-azure-powershell- 
dsc-desired-state-configuration-extension.aspx 
 
http://technet.microsoft.com/en-us/library/dn249927.aspx 
 
https://gallery.technet.microsoft.com/scriptcenter/DSC-Resource-Kit-All-c449312d

More Related Content

What's hot (20)

PDF
Command Bus To Awesome Town
Ross Tuck
PDF
Dutch PHP Conference - PHPSpec 2 - The only Design Tool you need
Kacper Gunia
PDF
Models and Service Layers, Hemoglobin and Hobgoblins
Ross Tuck
PDF
Couchdb
Brian Smith
PDF
Php unit the-mostunknownparts
Bastian Feder
PDF
When cqrs meets event sourcing
Manel Sell辿s
PDF
PHP Data Objects
Wez Furlong
KEY
Php 101: PDO
Jeremy Kendall
PPTX
DrupalCamp Foz - Novas APIs Drupal 7
chuvainc
PDF
Angular&node js upload file
Hu Kenneth
PDF
Things I Believe Now That I'm Old
Ross Tuck
PDF
Drush. Secrets come out.
Alex S
PDF
Advanced php testing in action
Jace Ju
PDF
Map/reduce, geospatial indexing, and other cool features (Kristina Chodorow)
MongoSF
PPTX
Async all around us (promises)
Francisco Ferreira
PDF
Dependency Injection with PHP and PHP 5.3
Fabien Potencier
PPT
Mocking Dependencies in PHPUnit
mfrost503
PPTX
AngularJS Services
Eyal Vardi
PDF
Temporary Cache Assistance (Transients API): WordCamp Phoenix 2014
Cliff Seal
PDF
WordPress as an application framework
Dustin Filippini
Command Bus To Awesome Town
Ross Tuck
Dutch PHP Conference - PHPSpec 2 - The only Design Tool you need
Kacper Gunia
Models and Service Layers, Hemoglobin and Hobgoblins
Ross Tuck
Couchdb
Brian Smith
Php unit the-mostunknownparts
Bastian Feder
When cqrs meets event sourcing
Manel Sell辿s
PHP Data Objects
Wez Furlong
Php 101: PDO
Jeremy Kendall
DrupalCamp Foz - Novas APIs Drupal 7
chuvainc
Angular&node js upload file
Hu Kenneth
Things I Believe Now That I'm Old
Ross Tuck
Drush. Secrets come out.
Alex S
Advanced php testing in action
Jace Ju
Map/reduce, geospatial indexing, and other cool features (Kristina Chodorow)
MongoSF
Async all around us (promises)
Francisco Ferreira
Dependency Injection with PHP and PHP 5.3
Fabien Potencier
Mocking Dependencies in PHPUnit
mfrost503
AngularJS Services
Eyal Vardi
Temporary Cache Assistance (Transients API): WordCamp Phoenix 2014
Cliff Seal
WordPress as an application framework
Dustin Filippini

More from Oleg Chorny (10)

PPTX
SQL_HA_DR_Azure
Oleg Chorny
PPTX
Docker&Azure
Oleg Chorny
PPTX
Gameaways
Oleg Chorny
PPTX
CD&Azure
Oleg Chorny
PPTX
Azure Expert Leading Camp UA - 2015
Oleg Chorny
PPTX
Application insights for visual studio online
Oleg Chorny
PPTX
Tale of the golden fish
Oleg Chorny
PPTX
Disaster recovery from scratch
Oleg Chorny
PPTX
Ten rules for sysadmin
Oleg Chorny
PPTX
Re fs
Oleg Chorny
SQL_HA_DR_Azure
Oleg Chorny
Docker&Azure
Oleg Chorny
Gameaways
Oleg Chorny
CD&Azure
Oleg Chorny
Azure Expert Leading Camp UA - 2015
Oleg Chorny
Application insights for visual studio online
Oleg Chorny
Tale of the golden fish
Oleg Chorny
Disaster recovery from scratch
Oleg Chorny
Ten rules for sysadmin
Oleg Chorny
Re fs
Oleg Chorny
Ad

Recently uploaded (20)

PDF
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
PDF
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
PDF
My Journey from CAD to BIM: A True Underdog Story
Safe Software
DOCX
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
PDF
Why aren't you using FME Flow's CPU Time?
Safe Software
PDF
Redefining Work in the Age of AI - What to expect? How to prepare? Why it mat...
Malinda Kapuruge
PDF
Open Source Milvus Vector Database v 2.6
Zilliz
PDF
Kubernetes - Architecture & Components.pdf
geethak285
PDF
Database Benchmarking for Performance Masterclass: Session 1 - Benchmarking F...
ScyllaDB
PDF
2025_06_18 - OpenMetadata Community Meeting.pdf
OpenMetadata
PDF
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
PDF
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
yosra Saidani
PDF
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
PPTX
reInforce 2025 Lightning Talk - Scott Francis.pptx
ScottFrancis51
PDF
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
PDF
Scaling i.MX Applications Processors Native Edge AI with Discrete AI Accele...
Edge AI and Vision Alliance
PPTX
Enabling the Digital Artisan keynote at ICOCI 2025
Alan Dix
PDF
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) 際際滷s
Ravi Tamada
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
PDF
MPU+: A Transformative Solution for Next-Gen AI at the Edge, a Presentation...
Edge AI and Vision Alliance
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
My Journey from CAD to BIM: A True Underdog Story
Safe Software
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
Why aren't you using FME Flow's CPU Time?
Safe Software
Redefining Work in the Age of AI - What to expect? How to prepare? Why it mat...
Malinda Kapuruge
Open Source Milvus Vector Database v 2.6
Zilliz
Kubernetes - Architecture & Components.pdf
geethak285
Database Benchmarking for Performance Masterclass: Session 1 - Benchmarking F...
ScyllaDB
2025_06_18 - OpenMetadata Community Meeting.pdf
OpenMetadata
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
yosra Saidani
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
reInforce 2025 Lightning Talk - Scott Francis.pptx
ScottFrancis51
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
Scaling i.MX Applications Processors Native Edge AI with Discrete AI Accele...
Edge AI and Vision Alliance
Enabling the Digital Artisan keynote at ICOCI 2025
Alan Dix
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) 際際滷s
Ravi Tamada
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
MPU+: A Transformative Solution for Next-Gen AI at the Edge, a Presentation...
Edge AI and Vision Alliance
Ad

Better Together: Microsoft Azure Virtual Machines & PowerShell Desired State Configuration

  • 2.
  • 7.
  • 8.
  • 9. $featureName = "telnet-client" $result = Get-WindowsFeature $featurename if ($result.InstallState -eq "Installed") { Write-host "$featureName already installed" } else { Write-host "$featureName is not installed, going to install it" Install-WindowsFeature $featureName }
  • 11.
  • 12. $node = "localhost" Configuration SecondDimension { node $node { WindowsFeature TelnetClient { Ensure = "Present" Name = "telnet-client" } } } SecondDimension Start-DscConfiguration -Wait -Verbose -Path .SecondDimension -force
  • 13.
  • 15.
  • 19.
  • 20. $subscriptionname = '仍舒仂仄 MSDN' $storageaccountname = 'dimensionsstg' $configurationpath = 'C:DimensionsDimensions.ps1' $vmname = 'Dimensions-SP1' $servicename = 'dimensions' $configurationarchive = 'Dimensions.ps1.zip' $configurationname = 'Dimensions' #Select subscription Select-AzureSubscription $subscriptionname #Select storage account where DSC configuration will be stored Set-AzureSubscription $subscriptionname -CurrentStorageAccountName $storageaccountname #Upload configuration into the storage account. Publish-AzureVMDscConfiguration -ConfigurationPath $configurationpath -Force #Apply DSC configuration to the $vmname $vmtoupdate = Get-AzureVM -Name $vmname -ServiceName $servicename $vmtoupdate = Set-AzureVMDSCExtension -VM $vmtoupdate ` ConfigurationArchive $configurationarchive -ConfigurationName $configurationname $vmtoupdate | Update-AzureVM
  • 22.
  • 23. Configuration Dimensions { Import-DscResource -ModuleName xSharepoint2010SP2 node 'localhost' { xSharepoint2010SP2 Install { Ensure = 'Present' Key = ABCDE-FGHIJ-KLMNO-PQRST-12345' DownloadLink = 'https://enterurl.com/en_sharepoint_server_2010.iso' MD5FileHash = '16B6B4781336659A28898120F8EA603D' TempFolder = 'C:Install' } } }
  • 24.
  • 25. http://www.slideshare.net/jallspaw/10-deploys-per-day-dev-and-ops-cooperation- at-flickr http://blogs.technet.com/b/privatecloud/archive/2013/08/30/introducing-powershell- desired-state-configuration-dsc.aspx http://blogs.msdn.com/b/powershell/archive/2014/08/07/introducing-the-azure-powershell- dsc-desired-state-configuration-extension.aspx http://technet.microsoft.com/en-us/library/dn249927.aspx https://gallery.technet.microsoft.com/scriptcenter/DSC-Resource-Kit-All-c449312d