Exercise - Assess Windows Server readiness
You can run the Azure File Sync evaluation PowerShell cmdlets on any Windows Server on which you want to use file sync. The cmdlets check the operating system, file system, file name, and folder name compatibility.
Before you install and set up Azure File Sync on your company's CAD file server, assess the server to ensure that it's compatible. You run the evaluation cmdlets to produce a report.
Important
You need your own Azure subscription to run this exercise, and you might incur charges. If you don't already have an Azure subscription, create a free account before you begin.
The following video shows how to do the assessment on your on-premises server. Follow the steps in this exercise to complete the assessment on a virtual machine that you create in your Azure subscription.
Create a Windows file server
You'd normally install Azure File Sync on your on-premises server. For this exercise, you create an Azure virtual machine (VM) to act as your Windows file server.
Sign in to the Azure portal.
From the menu bar on the top right-hand side, open Cloud Shell. Switch to the PowerShell environment from Bash environment in Cloud Shell dropdown list.
Run the following command to create a resource group. Replace
EastUS
with the value of a location near you.$resourceGroup = 'learn-file-sync-rg' $location = 'EastUS' New-AzResourceGroup -Name $resourceGroup -Location $location
This list shows some location values you can use:
- westus2
- southcentralus
- centralus
- eastus
- westeurope
- southeastasia
- japaneast
- brazilsouth
- australiasoutheast
- centralindia
In PowerShell, run the following commands to create a subnet and virtual network in the same location as the resource group:
$subnetConfig = New-AzVirtualNetworkSubnetConfig ` -Name Syncpublicnet ` -AddressPrefix 10.0.0.0/24 $virtualNetwork = New-AzVirtualNetwork ` -Name Syncvnet ` -AddressPrefix 10.0.0.0/16 ` -Location $location ` -ResourceGroupName $resourceGroup ` -Subnet $subnetConfig
Run the following command to set the username and password for the administrator account on the VM. Enter the User
learnadmin
and a password. The password needs to be at least eight characters long. It must include a digit, an uppercase letter, a lowercase letter, and a special character. Write down the password because you need it later.$cred = Get-Credential
Create the Windows Server machine:
New-Azvm ` -Name FileServerLocal ` -Credential $cred ` -ResourceGroupName $resourceGroup ` -Size Standard_DS1_v2 ` -VirtualNetworkName Syncvnet ` -SubnetName Syncpublicnet ` -Image "Win2019Datacenter"
Creating the VM takes a few minutes.
Create a public IP address and associate it with the file server VM
In order to connect to the new server using Remote Desktop, create a public IP address and assign it to the file server VM.
Sign in to the Azure portal.
In the Azure portal, in the top search box, search for and select Public IP addresses. The Public IP addresses pane appears.
Select + Create. The Create public IP address pane appears.
Select the same Azure subscription and location that you used for the VM. Select the learn-file-sync-rg resource group.
Leave the rest of the defaults as they are, and under Name, specify FileServerPublicIP.
Select Review + Create and then Create to create the public IP address.
In the top search box, search for and select Virtual machines. The Virtual machines pane appears.
Select the FileServerLocal VM. The FileServerLocal virtual machine pane appears.
Under Networking > Network settings, select the network interface called FileServerLocal.
Under Settings > IP configurations, select the IP configuration FileServerLocal.
Select Associate public IP address, and then for Public IP address select FileServerPublicIP.
Select Save.
Set up Windows Server for assessment
Connect to the new server by using Remote Desktop client. Download a sample CAD file and install the Azure PowerShell module that you use later.
Make sure that you're still signed in to the Azure portal.
In the top search box, search for and select Virtual machines. The Virtual machines pane appears.
Select the FileServerLocal VM. The FileServerLocal virtual machine pane appears.
In the top menu bar, select Connect. The Connect pane appears for your FileServerLocal VM. Select Native RDP.
Select Download RDP File.
Open the RDP file and select Connect.
In the Windows Security dialog box, select More choices, and then select Use a different account.
Enter the user name learnadmin and the password you used earlier, and then select OK.
If you're asked to connect despite certificate errors, select Yes. The Server Manager dashboard appears.
After you sign in, in the bottom task bar, select Search, enter cmd, and then select Command Prompt.
At the command prompt, enter D: and then select Enter.
Download this sample CAD file by using cURL:
curl https://github.com/MicrosoftDocs/mslearn-extend-share-capacity-with-azure-file-sync/blob/master/resources/CADFolder.zip?raw=true -L -o CADFolder.zip
Expand the zip file:
CADFolder.zip
In File Explorer, in the top menu bar, select Compressed Folder Tools, and then select Extract all and finally, select Extract.
Install the Azure PowerShell modules
In the bottom task bar, right-click Start, then select Windows PowerShell (Admin).
In the console, download the latest Azure PowerShell modules:
Install-Module -Name Az
If prompted, enter Y to install the NuGet provider and/or accept the untrusted repository. Do the same thing for any of the modules.
The modules take a few minutes to install.
Complete an assessment
With the evaluation cmdlets installed, check whether your file server and folders are compatible with Azure File Sync.
Do a system and data file check:
Invoke-AzStorageSyncCompatibilityCheck -Path D:\CADFolder
The output should look like this output:
Environment validation results: Computer name: localhost OS version check: Passed. File system check: Passed. Namespace validation results: Path: C:\CADFolder Number of files scanned: 4 Number of directories scanned: 6 There were no compatibility issues found with your files.
Test the files only:
Invoke-AzStorageSyncCompatibilityCheck -Path D:\CADFolder -SkipSystemChecks
Test system requirements only:
Invoke-AzStorageSyncCompatibilityCheck -ComputerName localhost
Save the results in a CSV file:
$results=Invoke-AzStorageSyncCompatibilityCheck -Path D:\CADFolder $results | Select-Object -Property Type, Path, Level, Description | Export-Csv -Path D:\assessment-results.csv
Leave the Remote Desktop connection open for a later exercise.