It opens a new powershell window and I can use the
New-PSDrive
cmdlet to map a network share for the “New User”. But first, the new Powershell window is unresponsive as long as I haven’t closed my old Powershell window. This feels very awkward.
Other things I tried.
Enabled-PSremoting
winrm quickconfig
and set the trustedhost -value to *
So I can run the New-PSDrive cmdlet via Invoke-Command with the credentials of the “NewUser” on my localmachine.
May be a silly question, but why are you trying to connect to a share as a different user than you are logged on as? Is the share a windows share or no?
We don’t have an active directory and we often have freelancer and employees who switch PCs. We always have to create their users manually. My idea was to create a script, which runs from local admin user and basicly does the work. So they can login, have their shares mounted, and the only thing that is left is that they have to sign in into their mail accounts.
I cannot test at the moment but I could imagine that you could use the task scheduler to help you out until you get a proper domain.
Something like this could be a start:
Of course you should fine tune the necessary settings.
BTW: Sometimes it’s easier to ask a technical question in your native language - there is a German Microsoft Powershell Forum as well … just in case.