cmartin Posted March 19, 2014 Share Posted March 19, 2014 I need to check whether current user has permission to access specific folders on a domain share (Window Active Directory). I have tested every _Net_Share function extensively but cannot seem to solve this problem. It could be syntactical (how to specify server and share). Server name is ad.xyz.edu There are multiple shares: share1, share2, etc. There are multiple folders in each share: share1fold1, share1fold2, share2fold3, share1fold3. Some folder have subfolders as well. I have read access to each share (I can open it in Windows), but not necessarily to each folder in each share. How do I check if the current user (me, for testing purposes) has access to a specific folder, say abc.xyz.edushare2folder1? I tried this with every possible combination of $sServer ans $sShare local $s, $sServer, $sShare, $aInfo $sServer="ad.xyz.edu" $sShare="med" $aInfo = _Net_Share_ShareGetInfo ( $sServer, $sShare ) $s = "InfoName: " & $aInfo[0]) & @CRLF & "InfoType: " & $aInfo[1]) & @CRLF & "InfoPerm: " & $aInfo[3]) Msgbox($MB_SYSTEMMODAL, "Results", $s) No matter what I specify, I get no error (@ERROR=0), and the value of each element in the array are empty. Is it possible to test this, and if so, what is the correct syntax? Using my examples: If I have access to abc.xyz.edushare2folder1, how would I use _Net_Share_ShareGetInfo(), and what return values should I get in the array? If I do not have access to abc.xyz.edushare2folder1, what return values should I get in the array? Many thanks, Chris M Link to comment Share on other sites More sharing options...
water Posted March 19, 2014 Share Posted March 19, 2014 Do you know the names of the Active Directory groups where you have to be a member of to get access to those shares? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
cmartin Posted March 19, 2014 Author Share Posted March 19, 2014 I don't know the names of the AD groups, but I can get the names. How would I use them? Link to comment Share on other sites More sharing options...
water Posted March 19, 2014 Share Posted March 19, 2014 If you know the name then you could check if the user is a member of this AD group by using my AD UDF, function _AD_IsMemberOf. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
cmartin Posted March 19, 2014 Author Share Posted March 19, 2014 Thanks, I will take a look at that function, since for this specific need I may be able to do that, but for long term I typically will not have the AD group names, so I was hoping to learn if it was possible to test if a user has read permission using the _Net_Share functions. Any other ideas along those lines would be very helpful. Chris M Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now