Software Development Kit (SDK) and API Discussions

Query NTFS permissions

hlteif
3,230 Views

Dear All,

I am trying to query NTFS ACL for shared volumes using the c# netapp-manageability-sdk-9.6.  The underlyning infrastructure is ontapi 1.120 Cluster-Mode and  NetApp Release 9.2
I imagine it is possible to do it as the output of the following CLI command shows th expected result.
"vserver security file-directory show -volume-name VOLUME1 -path /INPUT"

So I tried to use "file-directory-security-ntfs-dacl" and it returns the following result without any details.
<results status='passed'>
<num-records>0</num-records>
</results>

May be the result is correct.

My questions are :
1) is it possible to query NTFS security of volume/path thru the C# SDK?
2) does file-directory-security-ntfs-* is the right "function" to use? or is there any other function ?

In case it is not possible to use the SDK to do it, is there any other mean to automate this task as it will be regularly run to check the security.

thank you in advance
best regards
Hanna

4 REPLIES 4

GidonMarcus
3,104 Views

Hi

 

i assume that it's possible with the API as it's possible with Powershell.  (see other thread i participated: https://community.netapp.com/t5/Data-Infrastructure-Management-Software-Discussions/Creating-a-report-of-NTFS-permissions-based-on-a-CIFS-Share/td-p/1...)

 

Acording to powershell get-nchelp.

"Get-NcFileDirectorySecurity"  that i used in that thread is using the API call "file-directory-security-get". note that i also used the powershell parameter "expandmask" - and i don't know exactly how you apply this on an API call or if it maybe already there by default..

 

Note that you going to get it badly formatted - so if you can get it using native NTFS - i think it will be easier to work with.

 

Gidi

 

Gidi Marcus (Linkedin) - Storage and Microsoft technologies consultant - Hydro IT LTD - UK

hlteif
3,049 Views

Many thanks Gidon for your reply.

Indeed i went thru your response and trying to find with C# something equivalent, but without success. something is missing and i do not know what it is. I have to search.

In case I found the solution, I will share it.

 

best regards

Hanna

GidonMarcus
3,033 Views

Hi

 

can you share how do you use the "file-directory-security-get", maybe someone can test it for you as well. (i don't have access to lab for the next few weeks)

 

you can also try and sniff the powershell module http request and see what it sends. i think it should also be saved in \etc\log\audit (or cdot equivilent, i know that one from 7mode)

 

Gidi

Gidi Marcus (Linkedin) - Storage and Microsoft technologies consultant - Hydro IT LTD - UK

hlteif
2,990 Views

Hi Gidon,

thanks for your followup.

I found the source of the problem :

1) connection to netapp was done to "Cluster-mode" and not to the "VServer".

2) I was calling "file-directory-security-ntfs-dacl-get-iter" which is the wrong one ( related to point 1 ).

3) The function "file-directory-security-get" is not available in Cluster-mode.

 

Solution c#:

1) connect to Vserver by calling NaServer(...);

2) api = new NaElement("file-directory-security-get");

3) api.AddNewChild("path", "Physical Path");
4) api.AddNewChild("volume-name", "VolumeXXX");

5)....

 

Many thanks for you your help.

Best regards

Hanna

Public