Active IQ Unified Manager Articles and Resources

Get User From File

mbeattie

This workflow displays a user's information based on a DFS or UNC file path so you can contact the user before closing the CIFS lock on the file.

It requires the "vsadmin" credentials for the vserver to be added to the WFA credential cache and assume the WFA service has access to Active Directory to perform a NetBIOS name translation of the windows username. Example output:

11:28:13.108 INFO  [Get User From File] ### Command 'Get User From File' ###

11:28:33.978 INFO  [Get User From File] Executing command: ./Get_User_From_File7154496298102598648.ps1 -FileSpec '\\testlab.local\data\qtree01\databases\reports\reports.accdb'

11:28:34.268 INFO  [Get User From File] Executed Command: dfsutil.exe root export \\testlab.local\data \dfs.xml verbose downlevel

11:28:34.488 INFO  [Get User From File] Credentials successfully provided for 'nvaunsw100_mgmt'

11:28:50.778 INFO  [Get User From File] Connected to vserver "nvaunsw100" as "vsadmin"

11:28:51.798 INFO  [Get User From File] Enumerated the mount point for CIFS share "qtree01$" as "/nswsyd0101/qtree01"

11:28:51.918 INFO  [Get User From File] Enumerated the mount point for "\\testlab.local\data\qtree01\databases\reports\reports.accdb" as "/nswsyd0101/qtree01/databases/reports/reports.accdb"

11:29:25.397 INFO  [Get User From File] Executed Command: vserver locks show -vserver nvaunsw100 -path /nswsyd0101/qtree01/databases/reports/reports.accdb

11:29:25.877 INFO  [Get User From File] Executed Command: vserver cifs session show -vserver nvaunsw100 -address 192.168.100.14

11:29:26.207 INFO  [Get User From File] The file "\\testlab.local\data\qtree01\databases\reports\reports.accdb" is locked by user "TESTLAB\N2003704"

11:29:26.597 INFO  [Get User From File] Username: TESTLAB\N2003704

11:29:26.677 INFO  [Get User From File] FirstName: Matthew

11:29:26.757 INFO  [Get User From File] LastName: Beattie

11:29:26.877 INFO  [Get User From File] Phone Number: 8835-9118

11:29:26.947 INFO  [Get User From File] Email Address: matthew.beattie@testlab.local

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

Please Note:

All content posted on the NetApp Community is publicly searchable and viewable. Participation in the NetApp Community is voluntary.

In accordance with our Code of Conduct and Community Terms of Use, DO NOT post or attach the following:

  • Software files (compressed or uncompressed)
  • Files that require an End User License Agreement (EULA)
  • Confidential information
  • Personal data you do not want publicly available
  • Another’s personally identifiable information (PII)
  • Copyrighted materials without the permission of the copyright owner

Continued non-compliance may result in NetApp Community account restrictions or termination.

Replies
adaikkap

Hi Matt,

Nice Work.

Regards

adai

All Community Forums
Public