IT


How to use Azure State Configuration to open specific firewall ports

Azure Automation State Configuration is an Azure service that allows you to write, manage and compile PowerShell Desired State Configuration and assign them to target nodes.  Just like in an on oremise environment you can easily manage (virtual) machines running on Azure and also On Premise.

Using DSC it’s possible to set an (security) baseline to all your virtual machines. In this blogpost I describe how to enable specific ports from the Windows Server firewall.

Here is an example of a configuration file I use. As you can see I’m making use of the xNetworking module.

First you have to import the xNetworking module to Azure. Therefore go to your automation account. Go to Shared Resources, Modules and select Modules :
DSC01
Notice the Browse gallery in the upper pane :
DSC02
Now import the xNetworking module,
Now you can the add the code above to open a firewall port. In my example I opened (incoming) port 80.
There are several options although. You can find more information here.
You can use the following command’s on your node to update the configuration :

(This command checks the pull server for an updated configuration and applies it)

(This command applies the configuration to the node)

How to force the Windows 10 May Update

After an extended period of testing in the Release Preview ring, Microsoft has finally started rolling out the May 2019 Update to Windows 10 users, albeit in a “measured and throttled” way.

You might be able to get it now by going through Settings > Update & Security > Windows Update or, failing that, via the Media Creation tool. There is a very simple way to force Windows 10 to start the upgrade process immediately however.

If the new feature update is not currently showing up in Windows Update, then go to the Download Windows 10 page, and click on the Update now button. Doing so will download the Windows 10 Update Assistant — a small 5.9MB file.

Windows 10 Update

Save and launch this and then click the Update Now button. It will check to make sure your PC is compatible in terms of CPU, memory and disk space, and then download and verify the files needed for the update.


SMTP Relay on Azure using SendGrid

In this blogpost I’m going to explain how you can still be able to send SMTP from your IaaS server running on Azure. As you might already know since Nov 15th of 2017 it’s no longer always possible to send SMTP on port 25 (I dig into that later).

In that case Microsoft recommends that Azure customers employ authenticated SMTP relay services (typically connected via TCP port 587 or 443, but often support other ports too) to send e-mail from Azure VMs or from Azure App Services.  These services specialize in sender reputation to minimize the possibility 3rd party e-mail providers will reject the message.

Such SMTP relay services include but are not limited to SendGrid.  It is also possible you have a secure SMTP relay service running on premises that can be used. Use of these e-mail delivery services is in no way restricted in Azure regardless of subscription type.

Enterprise Agreement Customers

For Enterprise Agreement Azure customers, there is no change in the technical ability to send e-mail without using an authenticated relay.  Both new and existing Enterprise Agreement customers will be able to attempt outbound e-mail delivery from Azure VMs directly to external e-mail providers with no restrictions from the Azure platform.  While Microsoft cannot guarantee e-mail providers will accept inbound e-mail from any given customer, delivery attempts will not be blocked by the Azure platform for VMs in Enterprise Agreement subscriptions.  Customers will have to work directly with e-mail providers to resolve any message delivery or SPAM filtering issues with the specific provider.

Pay-As-You-Go Customers

For customers who signed up before November 15th, 2017 using the Pay-As-You-Go or Microsoft Partner Network subscription offers, there will be no change in the technical ability to attempt outbound e-mail delivery.  Customers will continue to be able to attempt outbound e-mail delivery from Azure VMs in these subscriptions directly to external e-mail providers with no restrictions from the Azure platform.  Again, Microsoft cannot guarantee e-mail providers will accept inbound e-mail from any given customer and customers will have to work directly with e-mail providers to resolve any message delivery or SPAM filtering issues with the specific provider.

For Pay-As-You-Go or Microsoft Partner Network subscriptions created after November 15, 2017, there will be technical restrictions blocking e-mail sent directly from VMs in these subscriptions.  Customers that need the ability to send e-mail from Azure VMs directly to external e-mail providers (not using an authenticated SMTP relay) can make a request to remove the restriction.  Requests will be reviewed and approved at Microsoft’s discretion and will be only granted after additional anti-fraud checks are performed.  To make a request, open a support case with the issue type Technical –> Virtual Network –> Connectivity –> Cannot send e-mail (SMTP/Port 25).  Be sure to add details about why your deployment needs to send mail directly to mail providers instead of going through an authenticated relay.

Once a Pay-As-You-Go or Microsoft Partner Network subscription gets exempted, VMs in that subscription only will be exempted going forward.  Microsoft reserves the right to revoke this exemption, should we determine a violation of our terms of service has occurred.

MSDN, Azure Pass, Azure in Open, Education, BizSpark, and Free Trial Customers

Customers who create MSDN, Azure Pass, Azure in Open, Education, BizSpark, and Free Trial subscriptions after November 15, 2017 will have technical restrictions blocking e-mail sent from VMs in these subscriptions directly to e-mail providers to prevent abuse.  No requests to remove the restriction can be made as they will not be granted.

Customers using these subscription types are encouraged to use SMTP relay services as outlined above.

Cloud Service Provider (CSP)

Customers that are consuming Azure resources via Cloud Service Provider (CSP) can create a support case with their Cloud Service Provider (CSP) of choice and request the CSP to create an unblock case on their behalf if a secure SMTP relay cannot be used.

SendGrid

SendGrid is a cloud-based email service that provides reliable transactional email delivery, scalability and real-time analytics along with flexible API’s that make custom intergation easy. Ideal for Azure!

First Step Configure your network security group (NSG)

You must allow your VM to send mail through port 587 (of 25). Therefore it’s a small task to allow that :

  1. Go to the networking pane of your Virtual Machine
  2. And choose to add an outbound port rule

NSG Port 587

Second step… create a SendGrid Account

Azure customers can unlock 25.000 (!) free emails each month. These 25.000 free monthly emails will give you access to advanced reporting and analytics and all API’s (Web, SMTP, Event, Parse and more).

Add the SendGrid Resource to your Azure account

  1. Sign in to the Azure portal.
  2. In the menu on the left, click Create a resource.

opdracht-balk-nieuw

3. Click Add-ons and then SendGrid Email Delivery.

sendgrid-opslaan

  1. Complete the signup form and select Create.
  2. sendgrid-maken
  3. Enter a Name to identify your SendGrid service in your Azure settings. Names must be between 1 and 100 characters in length and contain only alphanumeric characters, dashes, dots, and underscores. The name must be unique in your list of subscribed Azure Store Items.
  4. Enter and confirm your Password.
  5. Choose your Subscription.
  6. Create a new Resource group or use an existing one.
  7. In the Pricing tier section select the SendGrid plan you want to sign up for.sendgrid-prijzen
  8. Enter a Promotion Code if you have one.
  9. Enter your Contact Information.
  10. Review and accept the Legal terms.
  11. After confirming your purchase you will see a Deployment Succeeded pop-up and you will see your account listed in the All resources section.

    alle-resources
    After you have completed your purchase and clicked the Manage button to initiate the email verification process, you will receive an email from SendGrid asking you to verify your account. If you do not receive this email, or have problems verifying your account, please see this FAQ.

    beheren

    You can only send up to 100 emails/day until you have verified your account.

    To modify your subscription plan or see the SendGrid contact settings, click the name of your SendGrid service to open the SendGrid Marketplace dashboard.

    instellingen

    To send an email using SendGrid, you must supply your API Key.

To find your SendGrid API Key

  1. Click Manage.beheren
  2. In your SendGrid dashboard, select Settings and then API Keys in the menu on the left.API-sleutels
  3. Click the Create API Key.
  4. algemene-api-sleutel
  5. At a minimum, provide the Name of this key and provide full access to Mail Send and select Save.toegang
  6. Your API will be displayed at this point one time. Please be sure to store it safely.

To find your SendGrid credentials

  1. Click the key icon to find your Username.sleutel
  2. The password is the one you chose at setup. You can select Change password or Reset password to make any changes.

To manage your email deliverability settings, click the Manage button. This will redirect to your SendGrid dashboard.

beheren

You automatically will be logged on to the SendGrid page :

SendGrid Interface

Now go to settings, API keys to create an API key for SMTP relay. The API key is the password you need to authenticate. The SMTP server address is smtp.sendgrid.net:587 and the user is called apikey.

(Use these settings in your mailserver)


How to check your Office 365 tenant for auto-forward rules

Use the following steps to check for any Office 365 auto-forward rules to external email addresses.

In this blogpost I’m using Powershell to check for any existing auto-forward rules to external email addresses.

Step 1 Logon to Office 365 using Powershell

Step 2 Export the mailbox(es) that have either redirect or forwarding

This produces a list of all mailboxes that exist in the organization where the forwaring or redirect flags are enabled

Step 3 Investigate which rules are in use

Step 4 Remove the inbox rule from a specific mailbox

Step 5 Remove all the available inbox rules from all mailboxes (if you prefer)


Howto update ESXi without vCenter (Update Manager)

Use the following steps to upgrade your ESXi version to the latest version without download patches first! We are going to use Putty to talk against the command line 🙂

First step, put your ESXi server into maintenance mode :

Now we are going to check the profile version we are running

Or check the build version using the UI:

Now enable the host firewall rule to allow web traffic

Run the following command to list the online depot profiles available :

When you run into an error using the above command. Check your DNS and Gateway settings. ESXi needs to resolve some information using the internet!

Now let’s install the appropriate update, in my case I found out that I’m currently running 20170601001s. In your situation that can be different!

You can see what version you’re running using the previous command :

Ok, let’s reboot!

After installation I noticed the latest build :

Now set the firewall rule to the previous setting :

Final step exit maintenance mode :


Script to update all Azure Powershell Modules

Use this script to update all your Azure Powershell Modules to their latest versions.


Troubleshooting Visual Studio Code: language client undefined

Recently I ran into the following problem when editing Powershell scripts using Visual Studio Code ;

vscode_error1

First I tried to remove the specific extension. Go to the extenstion tab and check for installed extensions using @installed :

vscode_error4

Click the action/config wheel to uninstall the specific extension and reload and reinstall it. In my case that wasn’t the solution. I found out that the specific extension wasn’t completely removed. My solution was after removing the extension in Visual Studio Code, checking for any leftovers in %userprofile%\.vscode\extensions :

vscode_error2

After deleting the specific folder and reinstalling the extension the error was gone!

vscode_error3

 


Troubleshooting Office (/365) made easy

A collegae asked me for my support with a strange problem using Outlook 2016 (Click 2 Run).. She randomly received errors containing running out of memory resources although there were more then enough resources available… After the default checks (update, scanpst, registry settings max cache value etc) I tried the Office 365 troubleshooting tool (C2R) and that found the solution (issue with video driver and Outlook acceleration).

In this blogpost I describe how easy it is to use this tool and why you want to make use of it! Go to https://portal.office.com/account and go to tools & addins :

Office 365 troubleshooting 1

Choose the first option to download (and install) the Microsoft support assistant.

Office 365 troubleshooting 2

You can use this tool for solving issues with Outlook, Office, Onedrive and other Office-apps (forgive the Dutch screenshots)

After installing the executable you can use the tool. Choose where the tool can help you.

Office 365 troubleshooting 3

I advise you to run the tool on the device you ran into the problem. The tool investigates your environment, specs, eventlogs etc. Depending on the issue the cool could ask you for your (O365) credentials. I choose for the Outlook option and my Outlook stops responding in the second menu. After 2 minutes the tool found the solution and asked me for my approval to fix the issue.

This tool could help you for the first stage of investigation!


Free Azure IaaS Webinar with Microsoft’s Thomas Maurer

Implementing Infrastructure as a Service is a great way of streamlining and optimizing your IT environment by utilizing virtualized resources from the cloud to complement your existing on-site infrastructure. It enables a flexible combination of the traditional on-premises data center alongside the benefits of cloud-based subscription services. If you’re not making use of this model, there’s no better opportunity to learn what it can do for you than in the upcoming webinar from Altaro: How to Supercharge your Infrastructure with Azure IaaS.

The webinar will be presented by Thomas Maurer, who has recently been appointed Senior Cloud Advocate, on the Microsoft Azure Engineering Team alongside Altaro Technical Evangelist and Microsoft MVP Andy Syrewicze.

The webinar will be primarily focused on showing how Azure IaaS solves real use cases by going through the scenarios live on air. Three use cases have been outlined already, however, the webinar format encourages those attending to suggest their own use cases when signing up and the two most popular suggestions will be added to the list for Thomas and Andy to tackle. To submit your own use case request, simply fill out the suggestion box in the sign up form when you register!

Once again, this webinar is going to presented live twice on the day (Wednesday 13th February). So if you can’t make the earlier session (2pm CET / 8am EST / 5am PST), just sign up for the later one instead (7pm CET / 1pm EST / 10am PST) – or vice versa. Both sessions cover the same content but having two live sessions gives more people the opportunity to ask their questions live on air and get instant feedback from these Microsoft experts.

Save your seat for the webinar!

Altaro_Webinar.png

 


Unable to connect to share (System error 1272)

I noticed that I ran into a system error 1272 error to connect to a share residing on my NAS.  In Windows 10, version 1709 and higher (also Windows Server versions 1709 and higher) SMB2 guest access is disabled by default.

SMBv2 has the following behavior in Windows 10, version 1709, Windows Server version 1709, and Windows Server 2019:
  • Windows 10 Enterprise and Windows 10 Education no longer allow a user to connect to a remote share by using guest credentials by default, even if the remote server requests guest credentials.
  • Windows Server 2016 Datacenter and Standard edition no longer allow a user to connect to a remote share by using guest credentials by default, even if the remote server requests guest credentials.
  • Windows 10 Home and Professional editions are unchanged from their previous default behavior.

How to enable SMB2 guest access

If you want to enable insecure guest access, you can configure the following Group Policy settings:
Computer configuration\administrative templates\network\Lanman Workstation
“Enable insecure guest logons”
Note By enabling insecure guest logons, this setting reduces the security of Windows clients.

SMB03