locked
Command that will tell you what user security context a drive mapping was made under? RRS feed

  • Question

  • We have a shared server that requires drive mappings under a specific user account in order to run some scheduled tasks. Unfortunately, some of those drive mappings, while appearing correct, don't seem to have the right access permissions anymore.

    Is there a command that can be run to show what user context different drive mappings on a computer were made under?

    I "asked the duck" (and various search engines) if this is possible, but all signs point to "no one else has apparently asked this before, or you're using the wrong phrasing"
    Friday, September 20, 2019 3:52 PM

Answers

  • You cannot access anther users drive mappings. You can only access and see your own. This is a basic security boundary in Windows. If Get-PsDrive does not return a drive then you do not have it in your session.  You cannot see or access another users session.


    \_(ツ)_/

    • Marked as answer by MD5Hash Friday, September 20, 2019 8:59 PM
    Friday, September 20, 2019 7:33 PM

All replies

  • Aer you asking how to return the permissions on a folder or share?

    A mapping always occurs under the current users security context or under a set of credentials supplied when the drive is mapped.

    The  "you're using the wrong phrasing" suggestion may be what is gett9ing you in trouble. Try looking for articles that explain Windows security and how it works and is used. This may help you ask a better question.

    You can try this to see if it is what you are trying to ask.

    Get-PsDrive X | Select -expand Credential


    \_(ツ)_/


    • Edited by jrv Friday, September 20, 2019 4:14 PM
    Friday, September 20, 2019 4:12 PM
  • Hi jrv - so the way I see it, when you log into windows, that's one user context. But when you map a drive, you can tell it to use a different username/password to make the mapping. That's what I mean by user context. As you say "under a set of credentials supplied when the drive is mapped" - that's what I want to be able to look up, after the fact.

    On this shared server, people other than me have made 4 manual mappings. "Net use" shows me only where the mapping goes to, not what user account it's made under.

    I tried your powershell command, but the area under the resulting UserName Password return is blank when tested with Get-PsDrive Q (and X, Y, and Z, the entirety of the 4 mapped drives)

    Friday, September 20, 2019 7:23 PM
  • You cannot access anther users drive mappings. You can only access and see your own. This is a basic security boundary in Windows. If Get-PsDrive does not return a drive then you do not have it in your session.  You cannot see or access another users session.


    \_(ツ)_/

    • Marked as answer by MD5Hash Friday, September 20, 2019 8:59 PM
    Friday, September 20, 2019 7:33 PM