Hello Yadav,
Greetings! Welcome to Microsoft Q&A Platform.
To give access to a user’s local account for a file share connected to an Azure Virtual Machine (VM), consider the following steps:
1.Create a Folder:
Create a folder on the server where you want to share files.
Right-click on the folder, select “Properties,” and go to the “Sharing” tab.
Click “Advanced Sharing” and check the box next to “Share this folder.”
2.Set Permissions:
Click the “Permissions” button.
Click “Add” and enter the username of the new admin user.
Select the new user account from the list and click “OK.”
3.Access the Share:
On the client computer, map the network share using the new user credentials:
Right-click on the share name in Windows Explorer and choose “Map network drive.”
Alternatively, use the command prompt (run as administrator):
net use [drive] [share] /user:[user] [password]
Example: net use s: \server\share /user: admin2 pass123
Remember to replace [drive], [share], [user], and [password] with the appropriate values for your setup.
If you encounter any issues while trying to access the Azure VM drives, you may need to check the network security group (NSG) rules for the Azure VM. The NSG rules control inbound and outbound traffic to and from the VM and may need to be updated to allow traffic from your local laptop over the P2S VPN.
Similar thread for reference - https://answers.microsoft.com/en-us/windows/forum/all/folder-creation-and-sharing-i-want-to-create-an/ac5bcb2c-de5e-49cf-b9b9-ab6a5b335a2a.
Hope this answer helps! Please let us know if you have any further queries. I’m happy to assist you further.
Please "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.