Posted On January 6, 2023

Windows: How to Map Network Drive for All Users of a Local Machine

kimconnect 0 comments
blog.KimConnect.com >> Codes , Windows >> Windows: How to Map Network Drive for All Users of a Local Machine
# Mapping file share using legacy commands (more effective than newer PowerShell equivalents in certain scenarios)
$textContent=@'
net use m: /delete
net use m: \\FILESERVER\SHARENAME
'@
Set-Content "$env:ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\mountShares.bat" $textContent

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

Restricting Access to Directory in Windows Shares

- Only allow Admins write access to root folders- NTFS permissions at root directory for…

Sync AD OU Containers with Group Memberships

Script to Add Group Membership:for /f "tokens=*" %A IN ('dsquery user %PATH_TO_OU%') DO dsmod user…

PowerShell: Methods to Download Files

# Change these values to reflect your desired downloads$fileURL = "https://download.microsoft.com/download/0/d/9/0d9d81cf-4ef2-4aa5-8cea-95a935ee09c9/PortQryV2.exe"$output = "C:\WINDOWS\System32\SysInternals\portqry.exe"1. Start-BitsTransfer (my…