Adding Additional DNS Client Servers via Microsoft Intune using PowerShell
In my previous blog post, I discussed how to add additional DNS client servers using Group Policy Objects (GPOs) and PowerShell. In this blog post, we will explore the same process for all of your managed devices using Microsoft Intune.
As mentioned earlier, the best method of assigning DNS servers is through the DHCP server. However, if you do not have a DHCP server or want to use a more centralized approach, Microsoft Intune provides a solution using scripts and PowerShell.
To begin with, we will need to create a script that adds the additional DNS client servers to the managed devices. The script should be saved as “AddDNSClient.ps1” and placed on the desktop. We will then upload this script to the Microsoft Intune portal.
Once the policy is uploaded, it may take approximately 15-20 minutes for the policy to apply to the managed devices. To validate that the settings have been applied correctly, we can check the log files. To do this, go to the path “C:ProgramDataMicrosoftIntuneManagementExtensionLogs” and open the file “IntuneManagementExtension.txt.”
From here, you can search for the policy ID “cf09649b-78b7-4d98-8bcc-b122c29e5527” that we copied from the Intune portal hyperlink. This will show us if the policy has been applied successfully or not.
To apply additional DNS client servers using Microsoft Intune, follow these steps:
Step 1: Create a script called “AddDNSClient.ps1” and place it on your desktop.
Step 2: Upload the script to the Microsoft Intune portal.
Step 3: Wait for approximately 15-20 minutes for the policy to apply to the managed devices.
Step 4: Validate that the settings have been applied correctly by checking the log files in “C:ProgramDataMicrosoftIntuneManagementExtensionLogs” and searching for the policy ID “cf09649b-78b7-4d98-8bcc-b122c29e5527.”
In conclusion, adding additional DNS client servers using Microsoft Intune is a straightforward process that can be accomplished using PowerShell scripts. This centralized approach provides an easy way to manage all of your managed devices from one location. If you have any questions or need further assistance, please leave a comment below. Thank you for reading!