<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>SmrtRocks DevOps Journey</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/marcus_fernandez/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/marcus_fernandez/feed.xml</link>
    <description>DevOps living life as a constant learning opportunity</description>
    <lastBuildDate>Wed, 17 Apr 2019 04:08:19 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>EF 2.0 I am a believer</title>
      <link>https://docs.microsoft.com/archive/blogs/marcus_fernandez/ef-2-0-i-am-a-believer</link>
      <pubDate>Fri, 20 Oct 2017 19:39:56 GMT</pubDate>
      <dc:creator><![CDATA[smrtRock]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/marcus_fernandez/?p=75</guid>
      <description><![CDATA[EF Core 2.0 I am a believer
I am not much of a database guy, I enjoy code and am not a big fan of...]]></description>
      <content:encoded><![CDATA[<h1>  EF Core 2.0 I am a believer</h1>
<div>I am not much of a database guy, I enjoy code and am not a big fan of learning new \ old tools SQL Management Studio, SSIS, etc... not my forte.</div>
<div>So I am working on a project and exploring Database evolution.  The original project started with EF 6 the team struggled with that as there was no experts on the team and we found that there were some limitations around relationships that were getting lost in the code. So they migrated the EF 6 to a database project and at some point people started updated the Database Directly and doing schema compares to get the diffs back into the code.  Not a good flow in my opinion, as if you are a squirrel hunter looking for shiny objects and forget to compare you potentially impact the whole team.</div>
<div></div>
<div>In comes EF Core 2.0, and wow super simple way of taking an existing Database and bringing over at least the structure back to code first. The seeding of the data is currently not included in EF Core 2.0 but it is possible and I will walk you through that in a  separate post.</div>
<div>So here are the steps I went through in this example I will use [Northwind Samples for SQL 2016]('https://www.microsoft.com/en-us/download/details.aspx?id=49502')</div>
<ul>
 	<li>Create a new dotnet Core MVC application</li>
 	<li>Install the tools for EF Core 2.0</li>
 	<li>Scaffold the database</li>
</ul>
<h2>Create a new dotnet core MVC app</h2>
<div>Dotnet core command line tools have built in templates
<a href="https://msdnshared.blob.core.windows.net/media/2017/10/dotnetnew.png"><img width="300" height="199" class="alignnone size-medium wp-image-85" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/10/dotnetnew-300x199.png" /></a></div>
<h3>Install the tools for EF Core 2.0</h3>
Open the app, here using VSCode but can be Visual Studio whatever. Code or Visual Studio should take care of the initial dotnet cor packages necessary for a web project.  We will need the following packages
<ul>
 	<li>Microsoft.EntityFrameworkCore</li>
 	<li>Microsoft.EntityFrameworkCore.SqlServer</li>
 	<li>Microsoft.EntityFrameworkCore.SqlServer.Design</li>
 	<li>Microsoft.EntityFrameworkCore.Tools.DotNet (dotnet ef commands) or Microsoft.EntityFrameworkCore.Tools (powershell )</li>
</ul>
<div>Run the following command for each of the aforementioned packages, ensuring the minimum version is 2.0.0
<strong>DotNet CLI</strong></div>
<div>     dotnet add package &lt;packagename&gt;</div>
<div><strong>Powershell</strong>
Install-Package &lt;packageName&gt;</div>
<div></div>
<div>

Looking for a correction here not sure how to add the tooling except by editing the csproj file directly it should look as follows:

&lt;Project Sdk="Microsoft.NET.Sdk.Web"&gt;
&lt;PropertyGroup&gt;
&lt;TargetFramework&gt;netcoreapp2.0&lt;/TargetFramework&gt;
&lt;/PropertyGroup&gt;
&lt;ItemGroup&gt;
&lt;PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" /&gt;
&lt;PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.0.0" /&gt;
&lt;PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.0.0" /&gt;
&lt;/ItemGroup&gt;
&lt;ItemGroup&gt;
&lt;DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.0" /&gt;
&lt;DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0" /&gt;
&lt;/ItemGroup&gt;
&lt;/Project&gt;

</div>
<h3>```
Finally Scaffolding the database</h3>
<div>First up Scaffolding the database there is a command now called Scaffold-DbContext that does a great deal of the heavy lifting for you, creates your POCO (plain old code objects) and dbcontext along with any relationships, indexes etc...</div>
<div></div>
<div><strong>Powershell</strong>
Scaffold-DbContext -Connection "Server=localhost;Database=AdventureWorks2016CTP3;Integrated Security=true;" -Provider Microsoft.EntityFrameworkCore.SqlServer -Context AdventureWorksCtx -OutputDir .\Models -DataAnnotations

Scaffold-DbContext comand we just ran gets all the POCO (Plain Old Code Objects)  from the database, as well as the dbcontext and associated metadata about the tables and columns that the system can discern</div>
<div><strong>Note</strong> The Scaffold presents us with a couple of issues</div>
<ol>
 	<li>Once the command is run you will get a verbose output</li>
 	<li>Find the Context we referenced in the Scaffold command, here we called it AdventureWorksCtx
<a href="https://msdnshared.blob.core.windows.net/media/2017/10/ContextNotes.png"><img width="300" height="58" class="alignnone size-medium wp-image-96" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/10/ContextNotes-300x58.png" /></a>
Just past the DbSets for each of the tables you will find two important pieces of information
<ol>
 	<li>The Tables that could not be created and why</li>
 	<li>Below the table issues is the connection string we should make into either an Azure Secret or at a minimum move to a settings file</li>
</ol>
</li>
</ol>
<h4>References</h4>
<a href="https://docs.microsoft.com/en-us/ef/core/miscellaneous/cli/powershell">Tools for EF Core</a>

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>Deploy Azure Quickstarts to Azure Government</title>
      <link>https://docs.microsoft.com/archive/blogs/marcus_fernandez/deploy-azure-quickstarts-to-azure-government</link>
      <pubDate>Mon, 22 May 2017 15:42:21 GMT</pubDate>
      <dc:creator><![CDATA[smrtRock]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/marcus_fernandez/?p=57</guid>
      <description><![CDATA[Overview
Some great resources have been developed by the ALM Rangers, MVPs, and Microsoft Product...]]></description>
      <content:encoded><![CDATA[<div>
<div><strong>Overview</strong></div>
<div><span>Some great resources have been developed by the ALM Rangers, MVPs, and Microsoft Product Groups around Azure Quickstarts. Great place to get started should you need a pre-baked infrastructure. The old saying don't reinvent the wheel. The challenge my current project faced was deploying these quickstarts to Azure Government as they are currently tailored for the Commercial cloud. </span></div>
<div><span>In this post I'll walk you through publishing these resources to Azure Government. </span></div>
<div></div>
<div><strong>Prerequisites</strong></div>
<ul>
 	<li><span> </span><a href="https://docs.microsoft.com/en-us/azure/azure-government/documentation-government-image-gallery#quickstart-templates"><span>Azure Quickstarts</span></a></li>
 	<li><a href="https://portal.azure.us"><span>Azure Government Account</span></a></li>
</ul>
<div><span><strong>Select your desired Template</strong> </span></div>
<div><span>On this current project we were concerned with Technical Debt on the development of an ASP.NET Core application. So we are going with the Sonarqube in Azure template. </span></div>
<div><a href="https://github.com/Azure/azure-quickstart-templates/tree/master/sonarqube-azuresql"><span>Sonarqube on AzureSQL</span></a></div>
<div></div>
<div><span>Copy the link and from the blue button: Deploy to Azure</span></div>
<div><span>Paste the link in your browser address bar and the beginning of the link change from portal.azure.com to portal.azuer.us </span></div>
</div>
<div></div>
<div></div>]]></content:encoded>
    </item>
    <item>
      <title>O365 and PowerShell Part III (Gotchas and proposed solution)</title>
      <link>https://docs.microsoft.com/archive/blogs/marcus_fernandez/o365-and-powershell-part-iii-gotchas-and-proposed-solution</link>
      <pubDate>Thu, 14 Aug 2014 11:35:00 GMT</pubDate>
      <dc:creator><![CDATA[smrtRock]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/marcus_fernandez/2014/08/14/o365-and-powershell-part-iii-gotchas-and-proposed-solution/</guid>
      <description><![CDATA[Gotcha
The thing that occurred to me as I&nbsp; was connecting to each environment was the nuances,...]]></description>
      <content:encoded><![CDATA[<p class="Publishwithline"><span style="font-size: 2em;">Gotcha</span></p>
<p>The thing that occurred to me as I&nbsp; was connecting to each environment was the nuances, slight differences of connecting to each one.&nbsp; At the end of my preparation I had 4 different consoles going and an Integrated Scripting window running.&nbsp;</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/5822.Confusion.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/5822.Confusion.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/5822.Confusion.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/5822.Confusion.png" alt="" border="0" /></a></p>
<h1>More detail on the problem</h1>
<h2>Connecting to Exchange online</h2>
<ol>
<li>Open a PowerShell Command Prompt as an Administrator</li>
<li>Create a credential</li>
</ol>
<p>$Cred = New-Object&nbsp; PSCredential &ldquo;<a href="mailto:UserName@o365domain.onmicrosoft.com">UserName@o365domain.onmicrosoft.com</a>&rdquo;, (ConvertTo-SecureString &ldquo;&lt;Password&gt;&rdquo; &ndash;AsPlainText &ndash;Force)</p>
<ol>
<li>Create an Exchange Online Session</li>
</ol>
<p>$exchangeSession = New-PSSession &ndash;ConfigurationName Microsoft.Exchange &ndash;ConnectionUri <a href="https://ps.outlook.com/powershell">https://ps.outlook.com/powershell</a> -AllowRedirect -Authentication Basic -Credential $Cred</p>
<ol>
<li>Import the newly created Exchange session</li>
</ol>
<p>Import-PSSession $exchangeSession</p>
<p>What this whole process does is loads up in memory the Exchange online cmdlets to the current PowerShell host as well as creates a persistent connection to Exchange online so you can act upon your instance remotely.</p>
<h2>Connecting to SharePoint Online</h2>
<ol>
<li>Open the SharePoint &nbsp;Online Management Shell as an Administrator</li>
<li>Create a credential</li>
</ol>
<p>$Cred = New-Object&nbsp; PSCredential &ldquo;<a href="mailto:UserName@o365domain.onmicrosoft.com">UserName@o365domain.onmicrosoft.com</a>&rdquo;, (ConvertTo-SecureString &ldquo;&lt;Password&gt;&rdquo; &ndash;AsPlainText &ndash;Force)</p>
<ol>
<li>Connect to the SharePoint online administration site</li>
</ol>
<p>Connect-SPOService &ndash;Url <a href="https://%3Co365domain%3E-admin.sharepoint.com/">https://&lt;o365domain&gt;-admin.sharepoint.com</a> &ndash;credential $Cred</p>
<p>This whole process does a similar thing as the Exchange Online, however the PowerShell cmdlets are already loaded in the session and available within the management console.&nbsp;</p>
<h2>Connecting to Lync Online</h2>
<ol>
<li>Open a PowerShell Command Prompt as an Administrator</li>
<li>Create a credential</li>
</ol>
<p>$Cred = New-Object&nbsp; PSCredential &ldquo;<a href="mailto:UserName@o365domain.onmicrosoft.com">UserName@o365domain.onmicrosoft.com</a>&rdquo;, (ConvertTo-SecureString &ldquo;&lt;Password&gt;&rdquo; &ndash;AsPlainText &ndash;Force)</p>
<ol>
<li>Import the Lync Online connector module</li>
</ol>
<p>Import-Module LyncOnlineConnector</p>
<ol>
<li>Create an Lync Online Session</li>
</ol>
<p>$lyncSession = New-CsOnlineSession &ndash;Credential $Cred</p>
<p>Import-PSSession $lyncSession</p>
<p>NOTE: I did have problems at one point connecting to the session, I may not have cleaned up after myself, clearing out the session and the credentials got stale.&nbsp; This was remedied by rebooting the machine.&nbsp;</p>
<p>Connecting to O365</p>
<ol>
<li>Open the Windows Azure Active Directory Module for Windows PowerShell as an Administrator</li>
<li>Create a credential</li>
</ol>
<p>$Cred = New-Object&nbsp; PSCredential &ldquo;<a href="mailto:UserName@o365domain.onmicrosoft.com">UserName@o365domain.onmicrosoft.com</a>&rdquo;, (ConvertTo-SecureString &ldquo;&lt;Password&gt;&rdquo; &ndash;AsPlainText &ndash;Force)</p>
<ol>
<li>Connect to the O365 Service</li>
</ol>
<p>Connect-MSolService &ndash;Credential $Cred</p>
<h2>Summary</h2>
<p>Four different products to connect to, four slightly different ways to connect.&nbsp; This is what I call nuance and if I have to do something in a hurry I am less apt to do it through a scripting environment.</p>
<h1>A Possible Solution</h1>
<p>To ease my pain I setup my profile for the current user all hosts with some commands to get me going. Below is the script and steps to get it done</p>
<ol>
<li>&nbsp;Open PowerShell ISE as an Administrator, this may not be required, I do this out of habit.</li>
<li>Create a new directory</li>
</ol>
<p>New-Item &ndash;ItemType Directory &ndash;Path $env:UserProfile\Document\WindowsPowershell</p>
<ol>
<li>Create a new Profile.ps1 file</li>
</ol>
<p>New-Item &ndash;ItemType File &ndash;Path $env:UserProfile\Document\WindowsPowershell\Profile.ps1</p>
<ol>
<li>Open the newly created profile in the ISE and paste the next set of scripts, changing the &lt;Password&gt; and &lt;O365Domain&gt; to your respective domains and passwords.</li>
</ol>
<p>&nbsp;#region Setup Credentials&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $password = ConvertTo-SecureString "&lt;Password&gt;" -AsPlainText -Force</p>
<p>&nbsp;&nbsp;&nbsp; # Read-host -prompt "What is the password" -AsSecureString</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $Cred = New-Object pscredential "admin@&lt;o365Domain&gt;.onmicrosoft.com", $password # (ConvertTo-SecureString "pass@word1" -AsPlainText -Force)</p>
<p>#endregion</p>
<p>&nbsp;</p>
<p>#region connections</p>
<p>function Connect-O365Plus {</p>
<p>&nbsp;&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp; #region Setup for O365</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Import-Module msonline</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Connect-MsolService -Credential $Cred</p>
<p>&nbsp;&nbsp;&nbsp; #endregion</p>
<p>&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp; #region Setup for SharePoint Online</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Import-Module Microsoft.Online.SharePoint.Powershell</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Connect-SPOService -Url <a href="https://%3Co365domain%3E-admin.sharepoint.com/">https://&lt;o365Domain&gt;-admin.sharepoint.com</a> -Credential $o365Cred</p>
<p>&nbsp;&nbsp;&nbsp; #endregion</p>
<p>&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp; #region Setup for Lync Online</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Import-Module LyncOnlineConnector</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $lyncSession = New-CsOnlineSession -Credential $Cred</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Import-PSSession $lyncSession</p>
<p>&nbsp;&nbsp;&nbsp; #endregion</p>
<p>&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp; #region Setup for Exchange Online</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $exchangeSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Credential $Cred -Authentication Basic -AllowRedirection</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Import-PSSession $exchangeSession</p>
<p>&nbsp;&nbsp;&nbsp; #endregion</p>
<p>}</p>
<p>&nbsp;</p>
<p>function Connect-LyncOnline&nbsp; {</p>
<p>&nbsp;&nbsp;&nbsp; Import-Module LyncOnlineConnector</p>
<p>&nbsp;&nbsp;&nbsp; $lyncSession = New-CsOnlineSession -Credential $Cred</p>
<p>&nbsp;&nbsp;&nbsp; Import-PSSession $lyncSession</p>
<p>&nbsp;&nbsp;&nbsp;</p>
<p>}</p>
<p>&nbsp;</p>
<p>function Connect-ExchangeOnline {</p>
<p>&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp; #region Setup for Exchange Online</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $exchangeSession = New-PSSession -ConfigurationName Microsoft.Exchange `</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -ConnectionUri https://ps.outlook.com/powershell `</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -Credential $Cred -Authentication Basic -AllowRedirection</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Import-PSSession $exchangeSession</p>
<p>&nbsp;&nbsp;&nbsp; #endregion&nbsp;</p>
<p>}</p>
<p>&nbsp;</p>
<p>function Connect-SharePointOnline {</p>
<p>&nbsp; #region Setup for SharePoint Online</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Import-Module Microsoft.Online.SharePoint.Powershell</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Connect-SPOService -Url https://marcusfdemo-admin.sharepoint.com -Credential $Cred</p>
<p>&nbsp;&nbsp;&nbsp; #endregion</p>
<p>}</p>
<p>&nbsp;</p>
<p>function Connect-O365 {</p>
<p>&nbsp;&nbsp;&nbsp; #region Setup for O365</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Import-Module msonline</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Connect-MsolService -Credential $Cred</p>
<p>&nbsp;&nbsp;&nbsp; #endregion</p>
<p>}</p>
<p>#endregion&nbsp;</p>
<ol>
<li>Save and close the ISE and now when you open up a PowerShell console as an administrator you can connect to SharePoint Online (Connect-SharePointOnline), Exchange Online (Connect-ExchangeOnline), Lync Online (Connect-LyncOnline), O365 (Connect-O365), or the entire suite (Connect-O365Plus).&nbsp; Without having to recall the nuances.&nbsp;</li>
</ol>
<p>Hope everyone enjoys and let me know if you have any feedback.&nbsp;</p>
<h1>References</h1>
<p><strong>Connect to Office 365 by using a single Windows PowerShell window: &nbsp;</strong><a href="https://technet.microsoft.com/en-US/library/dn568015.aspx">https://technet.microsoft.com/en-US/library/dn568015.aspx</a></p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>O365 and PowerShell Part II (Why, more power of course)</title>
      <link>https://docs.microsoft.com/archive/blogs/marcus_fernandez/o365-and-powershell-part-ii-why-more-power-of-course</link>
      <pubDate>Thu, 14 Aug 2014 10:41:00 GMT</pubDate>
      <dc:creator><![CDATA[smrtRock]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/marcus_fernandez/2014/08/14/o365-and-powershell-part-ii-why-more-power-of-course/</guid>
      <description><![CDATA[Why PowerShell I Already Have an Admin Console? 
As I was going through all the trouble to setup my...]]></description>
      <content:encoded><![CDATA[<p><strong>Why PowerShell I Already Have an Admin Console? </strong></p>
<p>As I was going through all the trouble to setup my environment, get spun up on remoting, and finally fumbling through making my connections, this question occurred to me.&nbsp;</p>
<p>I found the following:</p>
<p><strong>More Information</strong></p>
<p>The console was limited in what information I could see.&nbsp;</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/4452.MoreInfo.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/4452.MoreInfo.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/4452.MoreInfo.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/4452.MoreInfo.png" alt="" border="0" /></a></p>
<p>What I got here is a quick side by side compare the properties I have accessible from O365 admin console and what I am able to pull up by running a quick Get-MSOLUser | Get-Member &ndash;MemberType Properties command.&nbsp;</p>
<p><strong>Features only PowerShell Can Configure</strong></p>
<p>As a former SharePoint administrator\developer this is very common.&nbsp; In SharePoint there are tons of features and modifications that can be made only through PowerShell.&nbsp; The following example is looking at what is available through the Lync Admin center vs. PowerShell.&nbsp; Specifically modifications to the default meeting settings, who are presenters by default, recording capability, and admission of anonymous users.&nbsp;</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/8623.OnlyPowershell.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/8623.OnlyPowershell.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/8623.OnlyPowershell.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/8623.OnlyPowershell.png" alt="" border="0" /></a></p>
<p>Online the only options I have are to make modifications to the URLs, display of presence information, and authorize users, on the left I within PowerShell I am able to modify the meeting configuration to deny anonymous users, designate presenters, and disable recording with the following command:&nbsp; Set-CsMeetingConfiguration &ndash;AdmitAnonymousUsersByDefault $false &ndash;AllowConferenceRecording $false &ndash;DesignateAsPresenter &ldquo;None&rdquo;.</p>
<p><strong>Bulk Operations </strong></p>
<p>In SharePoint online, as on premises to remove a users access from one or more sites can be a nontrivial event.&nbsp; Using PowerShell this operation can be performed as follows:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/5127.BulkOperations.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/5127.BulkOperations.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/5127.BulkOperations.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/5127.BulkOperations.png" alt="" border="0" /></a></p>
<p><strong>More Advanced Filtering</strong></p>
<p>Exchange Online Admin site allows you to lookup users add columns to the mailbox and do some basic filtering.&nbsp; I was curious about finding users in certain cities.&nbsp; After about a dozen clicks I was able to find the users mailboxes, add the city column and sort, that was it.&nbsp; Restricting down to certain locations I was not able to do.&nbsp; PowerShell it was a one line command</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/3618.AdvanceFiltering.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/3618.AdvanceFiltering.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/3618.AdvanceFiltering.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/3618.AdvanceFiltering.png" alt="" border="0" /></a></p>
<p>&nbsp;</p>
<h2>Print and Save</h2>
<p>PowerShell provides the ability to print and save data, which you could then open as a spreadsheet to do some basic or advanced reporting your choice.</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/5658.PrintAndSave.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/5658.PrintAndSave.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/5658.PrintAndSave.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/5658.PrintAndSave.png" alt="" border="0" /></a></p>
<p>In this example we get all Lync Users filter down to Display Name, User Principal Name, and Usage Location, send it to a comma delimited file.</p>
<h2>Cross product management</h2>
<p>Let&rsquo;s say you want to take some data from Exchange Online, O365, Lync, and SharePoint.&nbsp; Open several Internet Explorer Windows and bounce around after dozens of clicks and a lot of back and forth you may have the answer in an hour or more.&nbsp; Or you can just open PowerShell connect to Exchange online, Sharepoint Online, Lync Online, and O365 and run a pretty simple PowerShell query.&nbsp;</p>
<p>&nbsp;$users = Get-MsolUser</p>
<p>&nbsp;</p>
<p>foreach ($user in $users )</p>
<p>{</p>
<p>&nbsp;&nbsp;&nbsp; # Get and set the mailbox property</p>
<p>&nbsp;&nbsp;&nbsp; $mailbox = Get-Mailbox -Identity $user.UserPrincipalName</p>
<p>&nbsp;&nbsp;&nbsp; $user | Add-Member -MemberType NoteProperty -Name IsMailboxEnabled -Value $mailbox.IsMailboxEnabled</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp; # Get and set the Lync Property</p>
<p>&nbsp;&nbsp;&nbsp; $lync = Get-CsOnlineUser -Identity $user.UserPrincipalName</p>
<p>&nbsp;&nbsp;&nbsp; $user | Add-Member -MemberType NoteProperty -Name enabledForLync -Value $lync.enabled</p>
<p>&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp; $sharePoint =&nbsp; Get-SPOUser -LoginName "alans@&lt;o365Domain&gt;.onmicrosoft.com" -Site https://&lt;o365Domain&gt;.sharepoint.com</p>
<p>&nbsp;&nbsp;&nbsp; $user | Add-Member -MemberType NoteProperty -Name SharePointAdmin -Value $sharePoint.IsSiteAdmin</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp; $user | Add-Member -MemberType NoteProperty -Name EnabledSharePoint -Value $IsMemberMainSite</p>
<p>&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp; # Display my report who is licensed, has a mailbox and is enabled for lync</p>
<p>&nbsp;&nbsp;&nbsp; $user | select DisplayName, Islicensed, IsMailboxEnabled, EnabledForLync, SharePointAdmin</p>
<p>}&nbsp;</p>
<p>&nbsp;</p>
<h1>References</h1>
<p><strong>Six Reasons Why You Might Want to Use Windows PowerShell to Manage Office 365</strong>:&nbsp; <a href="https://technet.microsoft.com/en-us/library/dn568034.aspx">https://technet.microsoft.com/en-us/library/dn568034.aspx</a></p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>O365 and Powershell Part I (Getting Started)</title>
      <link>https://docs.microsoft.com/archive/blogs/marcus_fernandez/o365-and-powershell-part-i-getting-started</link>
      <pubDate>Thu, 14 Aug 2014 10:36:00 GMT</pubDate>
      <dc:creator><![CDATA[smrtRock]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/marcus_fernandez/2014/08/14/o365-and-powershell-part-i-getting-started/</guid>
      <description><![CDATA[Friend of mine asked me if I could present at a local users group he is trying to get off the ground...]]></description>
      <content:encoded><![CDATA[<p>Friend of mine asked me if I could present at a local users group he is trying to get off the ground in the local DC area for Office 365.&nbsp; My specialty at the moment is PowerShell so I attack from that angle.&nbsp; I started putting together my session and found plenty of resources but nothing that seem to fit my intent, which is to manage O365 from PowerShell, not consolidated in one place.&nbsp; I found that merely connecting and working with O365 in PowerShell in and of itself could be challenging so I decided to put my thoughts in a blog for future reference.</p>
<h1>What do I need to get started?</h1>
<p>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Windows 7, 8, 8.1</p>
<p>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .NET Framework 3.5.1 feature enabled with latest service packs</p>
<p>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;WeblogID=16540&amp;WeblogPostID=10550116" target="_blank">Microsoft Online Services Sign-In assistant</a></p>
<p>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="https://technet.microsoft.com/en-us/library/jj151815.aspx#bkmk_installmodule">Windows Active Directory (Azure AD) modules for the appropriate OS</a></p>
<p>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="https://www.microsoft.com/en-us/download/details.aspx?id=35588">SharePoint Online Management Shell</a></p>
<p>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="https://www.microsoft.com/en-us/download/details.aspx?id=39366">PowerShell Module for Lync Online</a></p>
<h1>Really Remote Remoting</h1>
<p>The first thing I learned about managing O365 was PowerShell Remoting is the first thing I had to get comfortable with.&nbsp; PowerShell remoting or Windows Remote Management (WinRM) has been around since PowerShell 2.0 and allows the ability to remotely administer servers.&nbsp; This concept is the foundation for working with Azure and O365.&nbsp; Some great resources on this topic can be found at the following:</p>
<p>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Scripting Guy:&nbsp; <a href="https://blogs.technet.com/b/heyscriptingguy/archive/2012/07/23/an-introduction-to-powershell-remoting-part-one.aspx">https://blogs.technet.com/b/heyscriptingguy/archive/2012/07/23/an-introduction-to-powershell-remoting-part-one.aspx</a></p>
<p>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PowerShell.Org:&nbsp; <a href="https://powershell.org/wp/2012/08/06/ebook-secrets-of-powershell-remoting/">https://powershell.org/wp/2012/08/06/ebook-secrets-of-powershell-remoting/</a> &nbsp;</p>
<p>So in the process of getting my machine setup I found a few common stumbles and they were all around remoting.&nbsp;</p>
<p># 1 Internal Firewall or WinRm not started</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/4251.BadWinRM.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/4251.BadWinRM.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/4251.BadWinRM.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/4251.BadWinRM.png" alt="" border="0" /></a></p>
<p>In my case the firewall was enabled.&nbsp;</p>
<p>#2 Bad Username or Password</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/3513.BadCredentials.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/3513.BadCredentials.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/3513.BadCredentials.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/3513.BadCredentials.png" alt="" border="0" /></a></p>
<p>This was just a fat finger of the password and username on my part, but could happen to anyone.&nbsp;&nbsp;</p>
<p><strong>References </strong></p>
<p>Microsoft Online Services Sign-In assistant: <a href="https://www.microsoft.com/en-us/download/details.aspx?id=39267">https://www.microsoft.com/en-us/download/details.aspx?id=39267</a></p>
<p>Install the Windows Azure Active Directory (Azure&nbsp;AD) module for the appropriate version of your operating system: <a href="https://technet.microsoft.com/en-us/library/jj151815.aspx#bkmk_installmodule">https://technet.microsoft.com/en-us/library/jj151815.aspx#bkmk_installmodule</a></p>
<p>SharePoint online management Shell&nbsp;<a href="https://www.microsoft.com/en-us/download/details.aspx?id=35588">https://www.microsoft.com/en-us/download/details.aspx?id=35588</a></p>
<p>PowerShell Module for Lync Online:&nbsp; <a href="https://www.microsoft.com/en-us/download/details.aspx?id=39366">https://www.microsoft.com/en-us/download/details.aspx?id=39366</a></p>
<p>Manage Azure AD using Windows PowerShell:&nbsp; <a href="https://technet.microsoft.com/en-us/library/jj151815.aspx">https://technet.microsoft.com/en-us/library/jj151815.aspx</a>&nbsp;</p>
<p>Exchange Online cmdlets: <a href="https://technet.microsoft.com/en-us/library/jj200780(v=exchg.150).aspx">https://technet.microsoft.com/en-us/library/jj200780(v=exchg.150).aspx</a></p>
<p>Index of Windows PowerShell for SharePoint Online cmdlets: <a href="https://technet.microsoft.com/en-us/office/fp161364(v=office.14).aspx">https://technet.microsoft.com/en-us/office/fp161364(v=office.14).aspx</a></p>
<p>Windows PowerShell cmdlets for Office 365 management and deployment: <a href="https://technet.microsoft.com/en-us/library/hh974317.aspx">https://technet.microsoft.com/en-us/library/hh974317.aspx</a></p>]]></content:encoded>
    </item>
    <item>
      <title>0 to Azure VM with PowerShell</title>
      <link>https://docs.microsoft.com/archive/blogs/marcus_fernandez/0-to-azure-vm-with-powershell</link>
      <pubDate>Tue, 27 May 2014 09:48:00 GMT</pubDate>
      <dc:creator><![CDATA[smrtRock]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/marcus_fernandez/2014/05/27/0-to-azure-vm-with-powershell/</guid>
      <description><![CDATA[I got a new laptop from MS, a thin and light model, great machine my thinking was can I function as...]]></description>
      <content:encoded><![CDATA[<p>I got a new laptop from MS, a thin and light model, great machine my thinking was can I function as a developer with all the additional requirements (SDKs, VM Test Environments etc..) that would entail.&nbsp; For the most part everything was OK except I could not run many if any VMs on the Carbon without either running out of&nbsp;resources, mainly RAM.&nbsp; So I turned to my new best friend Azure.&nbsp; If anyone has an MSDN subscription it comes with Azure compute time, can&rsquo;t speak to all SKUs, Ultimate comes with $150 credit each month.&nbsp;This blog post is my journey into Azure and automating the creation of test\dev environment, using Chocolatey.</p>
<p>This blog we will walk through the following:</p>
<ul>
<li><span style="color: #000000;"><span style="color: #000000;">Setting up machine to publish against Azure</span></span></li>
<li><span style="color: #000000;">Ensure Azure is Ready</span></li>
<ul>
<li><span style="color: #000000;">Affinity Group</span></li>
<li><span style="color: #000000;">Storage Account</span></li>
<li><span style="color: #000000;">Associate Local Machine</span></li>
<li><span style="color: #000000;">Cloud Service</span></li>
<li><span style="color: #000000;"><span style="color: #000000;">Network</span></span></li>
</ul>
<li><span style="color: #000000;">Deploy VM</span></li>
<li><span style="color: #000000;">Configure and Install Components</span></li>
</ul>
<p><span style="font-size: medium;"><strong>Setting up machine to publish against Azure</strong></span></p>
<p>Two prerequisite will be required:</p>
<ul>
<li>Azure Powershell:&nbsp; <a href="https://go.microsoft.com/fwlink/p/?linkid=320376&amp;clcid=0x409">https://go.microsoft.com/fwlink/p/?linkid=320376&amp;clcid=0x409</a></li>
<li>MSDN Subscription</li>
</ul>
<p>Once the Azure PowerShell is installed we can get started.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />On a&nbsp;computer running at least Windows 8 or Windows Server 2012, you can use the built-in Search. From the Start screen, begin typing <strong>power</strong>. This produces a scoped list of apps that includes Windows PowerShell and Azure PowerShell. Click either app to open the<br />console window. (To pin the app to the Start screen, right-click the icon.)</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />On a computer running a version earlier than Windows 8 or Windows Server 2012, you can use the Start menu. From the Start menu, click <strong>All Programs</strong>, click <strong>Azure</strong>, and then click <strong>Azure PowerShell</strong>.</p>
<p>Next up we&rsquo;ll need your Azure publishing settings file.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/3056.GetPublishingSettings.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/3056.GetPublishingSettings.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/3056.GetPublishingSettings.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/3056.GetPublishingSettings.png" alt="" border="0" /></a></p>
<p>This will open up the Azure portal you must sign into the account you wish to associate with this machine.</p>
<p>I use an internal employee Azure so I sign in through a federated page the public should see the regular Azure sig in either way you will see the following page and be prompted to download the subscription file.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/3652.ResultsGetPublishing.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/3652.ResultsGetPublishing.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/3652.ResultsGetPublishing.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/3652.ResultsGetPublishing.png" alt="" border="0" /></a></p>
<p>Next import the subscription file:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/5706.ImportPublishing.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/5706.ImportPublishing.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/5706.ImportPublishing.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/5706.ImportPublishing.PNG" alt="" border="0" /></a></p>
<p>With that you should be ready to publish your first VM to Azure.</p>
<h1>Ensure Azure is Ready</h1>
<p>Login to Azure and let&rsquo;s make sure the infrastructure is in place.&nbsp;</p>
<h2>Affinity Group</h2>
<h2><br />&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/4846.NewAffinityGroup.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/4846.NewAffinityGroup.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/4846.NewAffinityGroup.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/4846.NewAffinityGroup.PNG" alt="" border="0" /></a><br />Storage account</h2>
<h2><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/4251.NewStorageAccount.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/4251.NewStorageAccount.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/4251.NewStorageAccount.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/4251.NewStorageAccount.PNG" alt="" border="0" /></a><br />&nbsp;<br />Associate local machine with azure<br />subscription<br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/8535.SetAzureSubscription.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/8535.SetAzureSubscription.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/8535.SetAzureSubscription.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/8535.SetAzureSubscription.PNG" alt="" border="0" /></a></h2>
<h2>Cloud Service</h2>
<p>Azure Service Name, this has to be unique within Azure and can be tested using the Test-AzureName command.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/1882.NewAzureService.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/1882.NewAzureService.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/1882.NewAzureService.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/1882.NewAzureService.PNG" alt="" border="0" /></a></p>
<h2>Network</h2>
<p>Sample XML Import file</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/5148.NetConfig.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/5148.NetConfig.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/5148.NetConfig.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/5148.NetConfig.PNG" alt="" border="0" /></a></p>
<p>Once that is complete you should be ready for the deployment automation and build your very own Dev environment in Azure.&nbsp;</p>
<h1>Deploying the VM</h1>
<p>There are generally two options either way we need an image we will apply to the VM, here I have chosen the most recent Server 2012 R2 image.&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/7418.Image.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/7418.Image.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/7418.Image.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/7418.Image.PNG" alt="" border="0" /></a></p>
<p>Here we create an Azure VM with the New-AzureQuickVm</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/8284.NewQuickVM.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/8284.NewQuickVM.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/8284.NewQuickVM.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/8284.NewQuickVM.PNG" alt="" border="0" /></a></p>
<p>Or &nbsp;creating a configuration then passing it along to New-Azure</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/8372.NewVMConfig.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/8372.NewVMConfig.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/8372.NewVMConfig.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/8372.NewVMConfig.PNG" alt="" border="0" /></a></p>
<p>I personally like option two because it gives you more control over what resources the VM will consume, network assignments etc&hellip;, however for the purposes of this blog just doing a quick VM.&nbsp; I will attach scripts to do it both ways</p>
<p>In either case we need the following information:</p>
<ul>
<li>ServiceName, this is the cloud service we created earlier, mine is marcusf-demotr.&nbsp;</li>
<li>Name:&nbsp;this will be the name of the vm we are creating</li>
<li>ImageName: This is the Azure VM Image we are using to create the machine.&nbsp; These are updated frequently and can be found by running Get-AzureVMImage this will be a big list so restrict down by running Get-AzureVMImage | Where ImageName &ndash;match<br />server-2012-r2 | Select Name</li>
<li>Finally we need a user name and password I usually create credentials for this as follows</li>
</ul>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/5734.userobject.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/5734.userobject.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/5734.userobject.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/5734.userobject.png" alt="" border="0" /></a></p>
<p>These credentials can be consumed as follows:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/2678.ConsumeObject.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/2678.ConsumeObject.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/2678.ConsumeObject.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/2678.ConsumeObject.png" alt="" border="0" /></a></p>
<p>At this point you should have a fully functional VM in Azure, go ahead and log in and ensure you can reach the internet from this machine, this will be important later when we hit Chocolatey.&nbsp;</p>
<p>NOTE: So if you are using your MSDN account there may be additional images that have Visual Studio preloaded along with the Azure SDK.&nbsp; I am using a PFE account so Visual Studio is not included, this may be the same for your customers as well.&nbsp;&nbsp;</p>
<h1>Configuring the VM and Install the components</h1>
<p>There is one major prerequisite here as Azure runs everything behind some type of SSL we have to install a Win RM certificate on our local machine here is a script that will do the trick.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/6735.ConfigVMCert.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/6735.ConfigVMCert.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/6735.ConfigVMCert.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/6735.ConfigVMCert.png" alt="" border="0" /></a></p>
<p>Next up get the Uniform Resource Item</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/6646.URI.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/6646.URI.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/6646.URI.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/6646.URI.png" alt="" border="0" /></a></p>
<p>We are all set to start acting against our Azure VM remotely.</p>
<p>These may be some antiquated things and perhaps&nbsp;are not truly relevant but as a precaution on my dev environments I like to disable a few things, like User Access Control and Internet Explorer Enhanced Security Configuration.&nbsp; These two seem to hinder my progress as I am dev and test on a machine.&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/5164.configVM.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/5164.configVM.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/5164.configVM.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/5164.configVM.png" alt="" border="0" /></a></p>
<p>So the first configuration is to turn off UAC, the second is disabling IE enhanced security config and the final configuration is setting a DNS server.&nbsp; What I have had happen in the past is I have a domain on IaaS and turned off the dns server lo and behold my newly created vm could no longer access the outside world, so chocolatey or anything dependent on the internet would fail.&nbsp;<br />.&nbsp;</p>
<p>I start off by installing chocolatey, this is an open source project that allows Nuget type functionality for applications.&nbsp; After chocolatey and as I have been known to do some web dev in the past I use Fiddler a lot and finally Visual Studio.&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/3771.Install.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/3771.Install.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/40/3771.Install.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-40/3771.Install.png" alt="" border="0" /></a></p>
<p>You can find tons more packages at Choolatey.org.&nbsp;</p>
<p>Enjoy, and don't hesitate to provide some feedback, there is always something to learn</p>
<h1>Additional Resources</h1>
<p>Chocolatey &ndash; <a href="https://chocolatey.org">https://chocolatey.org</a></p>
<p>Azure there is a 31 days of Azure series that will walk you through in greater detail Azure VMs among other things:&nbsp; <a href="https://blogs.technet.com/b/chrisavis/archive/2013/01/25/the-31-days-of-servers-in-the-cloud-using-azure-iaas.aspx">https://blogs.technet.com/b/chrisavis/archive/2013/01/25/the-31-days-of-servers-in-the-cloud-using-azure-iaas.aspx</a></p>
<p>More detail on Chocolatey and other goodness check out Matt Wrocks blog:&nbsp; <a href="https://www.mattwrock.com/default.aspx">https://www.mattwrock.com/default.aspx</a></p>
<p>About Windows Azure Publish Settings File and how to create<br />your own Publish Settings File:&nbsp; <a href="https://gauravmantri.com/2012/09/14/about-windows-azure-publish-settings-file-and-how-to-create-your-own-publish-settings-file/">https://gauravmantri.com/2012/09/14/about-windows-azure-publish-settings-file-and-how-to-create-your-own-publish-settings-file/</a></p>
<p>What is a storage account? <a href="https://azure.microsoft.com/en-us/documentation/articles/storage-whatis-account/">https://azure.microsoft.com/en-us/documentation/articles/storage-whatis-account/</a></p>
<p>What is a cloud service? <a href="https://azure.microsoft.com/en-us/documentation/articles/cloud-services-what-is/">https://azure.microsoft.com/en-us/documentation/articles/cloud-services-what-is/</a></p>
<p>Importance of Windows Azure Affinity Groups:&nbsp;&nbsp; <a href="https://social.technet.microsoft.com/wiki/contents/articles/7916.importance-of-windows-azure-affinity-groups.aspx">https://social.technet.microsoft.com/wiki/contents/articles/7916.importance-of-windows-azure-affinity-groups.aspx</a></p>
<p>Windows Azure and the Virtual<br />Networking &ndash; What it is: <a href="https://blogs.technet.com/b/bobh/archive/2013/01/09/windows-azure-and-virtual-networking-what-it-is-31-days-of-windows-servers-vms-in-the-cloud-part-9-of-31.aspx">https://blogs.technet.com/b/bobh/archive/2013/01/09/windows-azure-and-virtual-networking-what-it-is-31-days-of-windows-servers-vms-in-the-cloud-part-9-of-31.aspx</a></p>
<p>Create a Windows Azure Network<br />using PowerShell: <a href="https://blogs.technet.com/b/kevinremde/archive/2013/01/19/create-a-windows-azure-network-using-powershell-31-days-of-servers-in-the-cloud-part-19-of-31.aspx">https://blogs.technet.com/b/kevinremde/archive/2013/01/19/create-a-windows-azure-network-using-powershell-31-days-of-servers-in-the-cloud-part-19-of-31.aspx</a></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/10/52/87/98/OneShot.ps1" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-10-52-87-98/OneShot.ps1">OneShot.ps1</a></p>]]></content:encoded>
    </item>
  </channel>
</rss>