I've taken over IT for a recently acquired company, and I'm trying to clean up their mess. They used a QNAP NAS in their domain, and we have a trust relationship established with them. Everything's reachable, but here's the snag: their setup was for the old domain, and the users have new accounts in our domain. I created a service account in their AD forest to map the NAS share, which works fine via PowerShell, but after a reboot, it's like it disappears. The drive shows up in Explorer, net use, and Get-PsDrive commands, but I can't access it. PowerShell just hangs when I try to change directories to it, and Explorer says the drive doesn't exist. When I attempt to remove it with Remove-PsDrive, nothing happens.
I suspected it was a session issue, so I added the credentials to Credential Manager via cmdkey, which worked fine locally, but after a reboot, it's back to being unusable. I have to remove it via command line/PowerShell, reboot, and then I can add it again.
I'm at my wit's end here. How can I safely and persistently map this NAS share? Any suggestions would be greatly appreciated!
**Update:** I've tried using New-PSDrive, net use, and New-SmbMapping, but none of them stay after a reboot, even with the persistent flag. I might have to resort to creating a scheduled task at login or turning my PowerShell script into an executable for the user's desktop.
3 Answers
Just to clarify, make sure you're using New-SmbMapping instead of New-PsDrive. I've heard it's specifically designed for this kind of task. Have you looked into that? It could be the solution you're looking for!
Totally feel you on that! It’s annoying when the tools just don’t work as expected. Let's keep brainstorming!
Since you've migrated their accounts to your domain, why not set up a dedicated file server in their environment? You could migrate the data and set up shares there. It might simplify things!
Have you considered joining the NAS to your new domain and setting up NTFS permissions from scratch using security groups? This way, users could authenticate with their AD accounts instead of a generic service account. It might be a better long-term fix, but I know it can be tough if the old CTO is against any changes. Good luck!
Yeah, I totally get that! Unfortunately, the old CTO is really against making any changes to their environment, which makes everything so much harder. We’re just trying to navigate this mess without causing any more drama.

I hadn’t heard of New-SmbMapping before, thanks for the tip! But unfortunately, even that doesn’t remain persistent after a reboot. It’s frustrating, right? Why is this all so complicated?