No announcement yet.

Determine Windows user Domain rights level

  • Filter
  • Time
  • Show
Clear All
new posts

  • Determine Windows user Domain rights level

    I have a program that uses psfile from Microsoft to get the status of files
    in use by remote servers. It's primarily used to determine if all users are out of the system and a backup can be made or if someone's workstation hung with files open etc,etc.

    psfile doesn't seem to give the right information unless a Domain Administrator is running it. Is there an api to determine if the currently logged in windows user has Admin rights to the Domain or should I just always assume they don't and bring up a dialog and pass it as a parameter on the psfile command line?

    Bob Mechler

  • #2
    Hey Bob.

    What about this one from Semen... isAdmin


    • #3
      Just curious if been updated to work with VISTA? or if any updates are needed?
      Engineer's Motto: If it aint broke take it apart and fix it

      "If at 1st you don't succeed... call it version 1.0"

      "Half of Programming is coding"....."The other 90% is DEBUGGING"

      "Document my code????" .... "WHYYY??? do you think they call it CODE? "


      • #4
        I ran the sample and a slight typo showed up. It's .pSid instead of .sid.

        Mine is an XP machine.

        Bob Mechler


        • #5
          The IsAdmin subroutine works in that it distinquishes between a Domain user and a Domain Admin. It seems that psfile can only report the user who has a file locked open if run by a Domain Admin.

          Is there any other way to determine what file is locked on a remote computer i.e. \\server and what user has it locked besides psfile?

          I'd like the person who is responsible for making a backup periodically (a domain user) during the day to be able to tell if a file is locked open by a process and who is running that process rather than tieing up the domain administrator's time.

          Also, when a domain user tries to run psfile at the command line with the username and password of a domain admin it doesn't succeed. Any thoughts on that?

          Bob Mechler


          • #6
            Finding locked files on a server


            That code will show the files that are locked and which userid has them locked. If you need a program that will then look up that userid to get more details like the user name, etc, I think I have also posted some code that looks up userid information. I also have an extended version of the above file lock code that will then let you double click on the lock to show the userids information. (let me know if you want that version.)
            "I haven't lost my mind... its backed up on tape... I think??" :D