Having a little trouble getting this to work. I am just beginning in powershell so forgive me if the question is stupid.
I can create a local mapped drive just fine with PS-drive. But what I am having issues with is creating a mapped on a remote PC.
We are on a domain. I want to be able to create mapped drives for a user logged into their PC. I could do a bat file and have them run it, but I want to be able to add this to our powershell script menu for all techs to just run and create whatever drive they need to for whatever user they need to. I would like to have the script run for the logged on user and not require a login from end user.
This seems like it should be such a simple thing to do, but I am having a heck of a time finding the correct info for this. Maybe its not possible.
When you remote into a computer, you create your own login session. Anything you do there is for YOU, not for other users of that computer. Windows is inherently a multi-user operating system, and users are isolated from each other. The only way to map a script for another user is to have a script run inside THEIR login. Which is what a logon script does. So, you'd need to either use a logon script, use Group Policy Preferences (either of those would be preferred), or get them to run a script.
Short of GPP, there's really not a way to do something to a user's session when that user isn't logged in. This isn't a PowerShell thing; it's part of how Windows works.
Most companies would probably use GPP or a logon script.
ok, thanks. Ya, we have plenty of login scripts and GPP, but users tend to map lots of drives on there own and when their systems needs to be rebuilt from a crash then we need to map the drives. Just would be nice not to have to remote in and do it or send them a bat file and have them do it. I was hoping there was a way to do it with the Credential Parameters and just use their account when logged in. Guess not. Thanks