Skip to content

Commit 734faae

Browse files
Merge pull request #212747 from khdownie/kendownie092722-2
replacing powershell
2 parents 57f84ab + 7488213 commit 734faae

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

articles/storage/files/storage-files-identity-ad-ds-configure-permissions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ The following permissions are included on the root directory of a file share:
6969

7070
## Connect to the Azure file share
7171

72-
Run the PowerShell script below or [use the Azure portal](storage-files-quick-create-use-windows.md#map-the-azure-file-share-to-a-windows-drive) to connect to the Azure file share using the storage account key and map it to drive Z: on Windows. If Z: is already in use, replace it with an available drive letter. The script will check to see if this storage account is accessible via TCP port 445, which is the port SMB uses. Remember to replace the placeholder values with your own values. For more information, see [Use an Azure file share with Windows](storage-how-to-use-files-windows.md).
72+
Run the script below from a normal (not elevated) PowerShell terminal to connect to the Azure file share using the storage account key and map the share to drive Z: on Windows. If Z: is already in use, replace it with an available drive letter. The script will check to see if this storage account is accessible via TCP port 445, which is the port SMB uses. Remember to replace the placeholder values with your own values. For more information, see [Use an Azure file share with Windows](storage-how-to-use-files-windows.md).
7373

7474
> [!NOTE]
7575
> You might see the **Full Control** ACL applied to a role already. This typically already offers the ability to assign permissions. However, because there are access checks at two levels (the share level and the file/directory level), this is restricted. Only users who have the **SMB Elevated Contributor** role and create a new file or directory can assign permissions on those new files or directories without using the storage account key. All other file/directory permission assignment requires connecting to the share using the storage account key first.

articles/storage/files/storage-files-identity-ad-ds-mount-file-share.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
---
22
title: Mount Azure file share to an AD DS-joined VM
3-
description: Learn how to mount a file share to your on-premises Active Directory Domain Services-joined machines.
3+
description: Learn how to mount an Azure file share to your on-premises Active Directory Domain Services domain-joined machines.
44
author: khdownie
55
ms.service: storage
66
ms.subservice: files
77
ms.topic: how-to
8-
ms.date: 06/22/2020
8+
ms.date: 09/27/2022
99
ms.author: kendownie
1010
---
1111

1212
# Part four: mount a file share from a domain-joined VM
1313

1414
Before you begin this article, make sure you complete the previous article, [configure directory and file level permissions over SMB](storage-files-identity-ad-ds-configure-permissions.md).
1515

16-
The process described in this article verifies that your file share and access permissions are set up correctly and that you can access an Azure File share from a domain-joined VM. Share-level Azure role assignment can take some time to take effect.
16+
The process described in this article verifies that your SMB file share and access permissions are set up correctly and that you can access an Azure file share from a domain-joined VM. Share-level role assignment can take some time to take effect.
1717

1818
Sign in to the client by using the credentials that you granted permissions to, as shown in the following image.
1919

@@ -28,30 +28,30 @@ Sign in to the client by using the credentials that you granted permissions to,
2828

2929
## Mounting prerequisites
3030

31-
Before you can mount the file share, make sure you've gone through the following pre-requisites:
31+
Before you can mount the Azure file share, make sure you've gone through the following prerequisites:
3232

33-
- If you are mounting the file share from a client that has previously mounted the file share using your storage account key, make sure that you have disconnected the share, removed the persistent credentials of the storage account key, and are currently using AD DS credentials for authentication. For instructions to clear the mounted share with storage account key, refer to [FAQ page](./storage-files-faq.md#ad-ds--azure-ad-ds-authentication).
34-
- Your client must have line of sight to your AD DS. If your machine or VM is out of the network managed by your AD DS, you will need to enable VPN to reach AD DS for authentication.
33+
- If you're mounting the file share from a client that has previously connected to the file share using your storage account key, make sure that you've disconnected the share, removed the persistent credentials of the storage account key, and are currently using AD DS credentials for authentication. For instructions on how to remove cached credentials with storage account key and delete existing SMB connections before initializing new connection with Azure AD or AD credentials, follow the two-step process on the [FAQ page](./storage-files-faq.md#ad-ds--azure-ad-ds-authentication).
34+
- Your client must have line of sight to your AD DS. If your machine or VM is outside of the network managed by your AD DS, you'll need to enable VPN to reach AD DS for authentication.
3535

36-
Replace the placeholder values with your own values, then use the following command to mount the Azure file share. You always need to mount using the path shown below. Using CNAME for file mount is not supported for identity based authentication (AD DS or Azure AD DS).
36+
## Mount the file share
3737

38-
```PSH
39-
# Always mount your share using.file.core.windows.net, even if you setup a private endpoint for your share.
38+
Run the PowerShell script below or [use the Azure portal](storage-files-quick-create-use-windows.md#map-the-azure-file-share-to-a-windows-drive) to persistently mount the Azure file share and map it to drive Z: on Windows. If Z: is already in use, replace it with an available drive letter. The script will check to see if this storage account is accessible via TCP port 445, which is the port SMB uses. Remember to replace the placeholder values with your own values. For more information, see [Use an Azure file share with Windows](storage-how-to-use-files-windows.md).
39+
40+
Always mount Azure file shares using.file.core.windows.net, even if you set up a private endpoint for your share. Using CNAME for file share mount isn't supported for identity-based authentication (AD DS or Azure AD DS).
41+
42+
```powershell
4043
$connectTestResult = Test-NetConnection -ComputerName <storage-account-name>.file.core.windows.net -Port 445
41-
if ($connectTestResult.TcpTestSucceeded)
42-
{
43-
net use <desired-drive letter>: \\<storage-account-name>.file.core.windows.net\<fileshare-name>
44-
}
45-
else
46-
{
47-
Write-Error -Message "Unable to reach the Azure storage account via port 445. Check to make sure your organization or ISP is not blocking port 445, or use Azure P2S VPN, Azure S2S VPN, or Express Route to tunnel SMB traffic over a different port."
44+
if ($connectTestResult.TcpTestSucceeded) {
45+
cmd.exe /C "cmdkey /add:`"<storage-account-name>.file.core.windows.net`" /user:`"localhost\<storage-account-name>`""
46+
New-PSDrive -Name Z -PSProvider FileSystem -Root "\\<storage-account-name>.file.core.windows.net\<file-share-name>" -Persist
47+
} else {
48+
Write-Error -Message "Unable to reach the Azure storage account via port 445. Check to make sure your organization or ISP is not blocking port 445, or use Azure P2S VPN, Azure S2S VPN, or Express Route to tunnel SMB traffic over a different port."
4849
}
49-
5050
```
5151

5252
If you run into issues mounting with AD DS credentials, refer to [Unable to mount Azure Files with AD credentials](storage-troubleshoot-windows-file-connection-problems.md#unable-to-mount-azure-files-with-ad-credentials) for guidance.
5353

54-
If mounting your file share succeeded, then you have successfully enabled and configured on-premises AD DS authentication for your Azure file shares.
54+
If mounting your file share succeeded, then you've successfully enabled and configured on-premises AD DS authentication for your Azure file share.
5555

5656
## Next steps
5757

0 commit comments

Comments
 (0)