Jump to content

_Net_Share_FileGetInfo() and _Net_Share_PermStr() question


Recommended Posts

I am trying to grab all permissions from all folders on one of our servers so they can be analyzed and possibly cleaned up and reorganized when we move to a new server. I took a look at these functions and they seem like they might help but I have 2 problems.

First, I am not sure if _Net_Share_FileGetInfo() can look at all files or if it can just look at open ones like in the example from the help file.

Second, _Net_Share_PermStr() although it only interprets data from _Net_Share_FileGetInfo() so the problem is there, does not seem to return proper permissions for folders.

I tried the example in the help file and looked at open files. I found if I have a file open I might see R--E---

but in the same directory (all inherited permissions) a folder would say only R------ even if it has execute permissions as well.

This might be a problem or limitation of the netapi32.dll call but I don't have a lot of knowledge about that dll. Is there any way to view full correct permissions on folders?

Before you suggest others though know that I already tried xcacls.exe and it is worse because even the files in the folder said 'R' only with no 'E'. I also tried SetACL.exe which returned only half of the listed users with permissions, and said they all had FULL permissions which they do not.

Link to comment
Share on other sites

Hi,

for this kind of tasks, i always use dumpsec.

You can dump security information with various report options.

;-))

Stefan

And I have written a Script to display the dumpsec information in a treeview. It lets you search for directory names, groups, users and marks the directories the user/group can access.

If you like I can send you a copy.

It's been written quick&dirty so it's nothing I can post here without some cleaning up beforehand.

An old version with a screenshot has been posted here.

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Thanks 99ojo! Just the tool I was looking for. I might have use for the script in the future water, for now this is ok but I'll know who to contact later if I need something like that =)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...