See How to Run PowerShell Commands on Remote Computers on how to run PS commands remotely, then Powershell: how to map a network drive with a different username/password on the specific command you need.
Powershell - WinRM - Map a drive with remote credentials
-
29-06-2022 - |
Question
Is there a way to use WinRM to map a drive on a remote machine with the credentials of the session logged in on that remote machine, WITHOUT prompting the user to input their credentials.
Edit: This machine is on an AD domain, so ideally using the existing auth ticket would be nice.
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow