Notification

Icon
Error

Shares on Windows computers and their share permissions

Posted: Monday, January 5, 2015 6:33:23 PM(UTC)
Daniel.B

Daniel.B

Member Original PosterPosts: 1,150
12
Like
List of all configured Share folders, including the share permissions set on each folder


Meets all the following criteria:
- Active Asset
- Windows Asset
- Network Share folders configured

Sorted on:
- Asset name

Code:
Select Top 1000000 tblAssets.AssetID,
  tblAssets.AssetUnique,
  tblAssets.Domain,
  tblAssets.Description,
  tsysOS.OSname,
  tblSharesUni.Name,
  tblSharesUni.Path,
  tsysOS.Image As icon,
  tblSharePermissions.trustee As [for user/group],
  Case When tblSharePermissions.readAccess = 1 Then 'y' Else 'n' End As [Read],
  Case When tblSharePermissions.writeAccess = 1 Then 'y' Else 'n' End As Write,
  Case When tblSharePermissions.fullAccess = 1 Then 'y' Else 'n' End As [Full],
  Case When tblSharePermissions.denyAccess = 1 Then 'y' Else 'n' End As Denied,
  tblShares.Lastchanged
From tblShares
  Inner Join tblAssets On tblShares.AssetID = tblAssets.AssetID
  Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
  Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
  Inner Join tblSharesUni On tblShares.ShareUniqueID =
    tblSharesUni.ShareUniqueID
  Inner Join tblSharePermissions
    On tblShares.ShareID = tblSharePermissions.ShareID
Where tblAssetCustom.State = 1 And tblSharesUni.Type = 0
Order By tblAssets.AssetName
sukaitsu
#1sukaitsu Member Posts: 54  
posted: 1/5/2015 6:41:58 PM(UTC)
Great report! I noticed there needs to be ' ' surrounding the End As aliases in your case statement.

Code:
Case When tblSharePermissions.readAccess = 1 Then 'y' Else 'n' End As 'Read',
Case When tblSharePermissions.writeAccess = 1 Then 'y' Else 'n' End As 'Write',
Case When tblSharePermissions.fullAccess = 1 Then 'y' Else 'n' End As 'Full',
Case When tblSharePermissions.denyAccess = 1 Then 'y' Else 'n' End As 'Denied',


Thank you,

Jeffrey
Daniel.B
#2Daniel.B Member Original PosterPosts: 1,150  
posted: 1/6/2015 1:36:08 PM(UTC)
Thanks for the reminder. We have corrected it in the report above.
Bradford
#3Bradford Member Posts: 6  
posted: 3/3/2015 8:00:17 AM(UTC)
Thanks Daniel, this looks like exactly what I need...

Unfortunately though when I paste in the code and save I get this error:

"Error while saving: "There was an error parsing the query. [ Token line number = 1,Token line offset = 299,Token in error = Read ]""

I just copied it manually (vs copy and pasting) and I am still getting the same error.

Please help, I do not know enough about SQL to understand what I am doing at this point, or what type of error this is.

Thanks!
Daniel.B
#4Daniel.B Member Original PosterPosts: 1,150  
posted: 3/3/2015 12:59:13 PM(UTC)
I've modified the report in the first post again. It still had a syntax mistake in the alias names.
Bradford
#5Bradford Member Posts: 6  
posted: 3/3/2015 7:23:18 PM(UTC)
It's working now. Thanks so much guys!
Rami Ferwana
#6Rami Ferwana Member Posts: 2  
posted: 11/16/2015 7:27:27 AM(UTC)
Can you add the display name ,login name, department, title and manager name for [for user/group]?

I need a report with shared folder permissions contain users from different departments
Susan.A
#7Susan.A Member Administration Posts: 1,536  
posted: 11/17/2015 1:21:53 PM(UTC)
Originally Posted by: Rami Ferwana Go to Quoted Post
Can you add the display name ,login name, department, title and manager name for [for user/group]?

Please try the report below.
Code:
Select Top 1000000 tblAssets.AssetID,
  tblAssets.AssetUnique,
  tblAssets.Domain,
  tblAssets.Description,
  tsysOS.OSname,
  tblSharesUni.Name,
  tblSharesUni.Path,
  tsysOS.Image As icon,
  tblSharePermissions.trustee As [for user/group],
  tblADusers.Username,
  tblADusers.Userdomain,
  tblADusers.Displayname,
  tblADusers.Department,
  tblADusers.Title,
  tblADObjects.sAMAccountName As Manager,
  Case When tblSharePermissions.readAccess = 1 Then 'y' Else 'n' End As [Read],
  Case When tblSharePermissions.writeAccess = 1 Then 'y' Else 'n' End As Write,
  Case When tblSharePermissions.fullAccess = 1 Then 'y' Else 'n' End As [Full],
  Case When tblSharePermissions.denyAccess = 1 Then 'y' Else 'n' End As Denied,
  tblShares.Lastchanged
From tblShares
  Inner Join tblAssets On tblShares.AssetID = tblAssets.AssetID
  Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
  Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
  Inner Join tblSharesUni On tblShares.ShareUniqueID =
    tblSharesUni.ShareUniqueID
  Inner Join tblSharePermissions
    On tblShares.ShareID = tblSharePermissions.ShareID
  Left Join tblADusers On tblADusers.Userdomain + '\' + tblADusers.Username =
    tblSharePermissions.trustee
  Left Join tblADObjects On tblADObjects.ADObjectID =
    tblADusers.ManagerADObjectId
Where tblAssetCustom.State = 1 And tblSharesUni.Type = 0
Order By tblAssets.AssetName
Rami Ferwana
#8Rami Ferwana Member Posts: 2  
posted: 11/18/2015 5:56:40 AM(UTC)
Great Support Thank you Angel
echernov
#9echernov Member Posts: 5  
posted: 1/21/2016 8:58:22 PM(UTC)
Hi All,

can you please explain if I can run this report and how on the network share ?

example: I have network share \\domain\department with many subfolders .
I need to know who has an access to the \\domain\department\xxxxx folder ?

can I use this report ?

thanks
Susan.A
#10Susan.A Member Administration Posts: 1,536  
posted: 1/22/2016 12:12:39 PM(UTC)
Originally Posted by: echernov Go to Quoted Post
can you please explain if I can run this report and how on the network share ?

example: I have network share \\domain\department with many subfolders .
I need to know who has an access to the \\domain\department\xxxxx folder ?

can I use this report ?

Lansweeper only scans share permissions, not folder permissions. Reporting on folder permissions is not currently possible. This feature is on our customer wish list, but we do not have a release date for it at this time.
echernov
#11echernov Member Posts: 5  
posted: 1/22/2016 3:41:07 PM(UTC)
thanks.
sorry maybe I was not clear .
the report is scanning all assets for the network shares.
the report is working just fine .
how I specify specific asset with specific share name ?
I need to scan one server(one asset ) and all shares that in that server.

I hope I was clear.

thanks

Ed
Susan.A
#12Susan.A Member Administration Posts: 1,536  
posted: 1/30/2016 4:10:56 PM(UTC)
Originally Posted by: echernov Go to Quoted Post
how I specify specific asset with specific share name ?
I need to scan one server(one asset ) and all shares that in that server.

You can filter the Assetname column within the report results to only list shares on a specific computer. There are search boxes in the report output, at the top of every column.
Reen87
#13Reen87 Member Posts: 8  
posted: 2/2/2016 12:41:59 PM(UTC)
Is it posible for this report to only show computer with server OS?
Jeremy.D
#14Jeremy.D Member Posts: 44  
posted: 2/4/2016 2:16:41 PM(UTC)
Originally Posted by: Reen87 Go to Quoted Post
Is it posible for this report to only show computer with server OS?

You can limit any report, including the one in this forum topic, to servers by following the instructions in this thread.
Piyush.Rawat
#15Piyush.Rawat Member Posts: 1  
posted: 8/30/2016 2:32:08 PM(UTC)
Originally Posted by: Susan.A Go to Quoted Post
Originally Posted by: Rami Ferwana Go to Quoted Post
Can you add the display name ,login name, department, title and manager name for [for user/group]?

Please try the report below.
Code:
Select Top 1000000 tblAssets.AssetID,
  tblAssets.AssetUnique,
  tblAssets.Domain,
  tblAssets.Description,
  tsysOS.OSname,
  tblSharesUni.Name,
  tblSharesUni.Path,
  tsysOS.Image As icon,
  tblSharePermissions.trustee As [for user/group],
  tblADusers.Username,
  tblADusers.Userdomain,
  tblADusers.Displayname,
  tblADusers.Department,
  tblADusers.Title,
  tblADObjects.sAMAccountName As Manager,
  Case When tblSharePermissions.readAccess = 1 Then 'y' Else 'n' End As [Read],
  Case When tblSharePermissions.writeAccess = 1 Then 'y' Else 'n' End As Write,
  Case When tblSharePermissions.fullAccess = 1 Then 'y' Else 'n' End As [Full],
  Case When tblSharePermissions.denyAccess = 1 Then 'y' Else 'n' End As Denied,
  tblShares.Lastchanged
From tblShares
  Inner Join tblAssets On tblShares.AssetID = tblAssets.AssetID
  Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
  Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
  Inner Join tblSharesUni On tblShares.ShareUniqueID =
    tblSharesUni.ShareUniqueID
  Inner Join tblSharePermissions
    On tblShares.ShareID = tblSharePermissions.ShareID
  Left Join tblADusers On tblADusers.Userdomain + '\' + tblADusers.Username =
    tblSharePermissions.trustee
  Left Join tblADObjects On tblADObjects.ADObjectID =
    tblADusers.ManagerADObjectId
Where tblAssetCustom.State = 1 And tblSharesUni.Type = 0
Order By tblAssets.AssetName


Is there any way that the name of the owner/user who created/altered the "share" is included in the report ?
jlennon101
#16jlennon101 Member Posts: 2  
posted: 10/10/2016 5:43:43 PM(UTC)
Hi I tried using the script at the top of this post but I always get the following error:


Invalid SELECT statement. Unexpected token "When" at line 10, pos 8.: Unexpected token "When" at line 10, column 8


Just for arguments sake the script is:


Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetUnique,
tblAssets.Domain,
tblAssets.Description,
tsysOS.OSname,
tblSharesUni.Name,
tblSharesUni.Path,
tsysOS.Image As icon,
tblSharePermissions.trustee As [for user/group],
Case When tblSharePermissions.readAccess = 1 Then 'y' Else 'n' End As [Read],
Case When tblSharePermissions.writeAccess = 1 Then 'y' Else 'n' End As Write,
Case When tblSharePermissions.fullAccess = 1 Then 'y' Else 'n' End As [Full],
Case When tblSharePermissions.denyAccess = 1 Then 'y' Else 'n' End As Denied,
tblShares.Lastchanged
From tblShares
Inner Join tblAssets On tblShares.AssetID = tblAssets.AssetID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Inner Join tblSharesUni On tblShares.ShareUniqueID =
tblSharesUni.ShareUniqueID
Inner Join tblSharePermissions
On tblShares.ShareID = tblSharePermissions.ShareID
Where tblAssetCustom.State = 1 And tblSharesUni.Type = 0
Order By tblAssets.AssetName
simon.wilks@emeralditms.co.uk
posted: 3/2/2021 10:02:04 AM(UTC)
Morning

any variations of this reporting NTFS permissions?

( I cant see a table with anything link ntfs in)
RC62N
#18RC62N Member Posts: 522  
posted: 3/2/2021 4:51:50 PM(UTC)
Recording/reporting NTFS permissions is out of scope for LANSweeper. See here for examples. (Not an endorsement, just one of many Google results.)

Active Discussions

Lansweeper Changing picture in Assets, New Location error.
by  jmani   Go to last post Go to first unread
Last post: Today at 2:44:27 PM(UTC)
Lansweeper USB printers with toner levels
by  rader  
Go to last post Go to first unread
Last post: Today at 12:29:27 AM(UTC)
Lansweeper Showing all assets without a department
by  Andy.S   Go to last post Go to first unread
Last post: Yesterday at 8:30:43 AM(UTC)
Lansweeper Patch Volume Across Fleet
by  darren.kimber  
Go to last post Go to first unread
Last post: Yesterday at 8:29:33 AM(UTC)
Lansweeper Count by Department
by  Brandon   Go to last post Go to first unread
Last post: 4/21/2021 7:42:00 PM(UTC)
Lansweeper Adding computer type to Windows 10 report
by  Brandon   Go to last post Go to first unread
Last post: 4/19/2021 6:38:45 PM(UTC)
Report Center Hardware Inventory
by  Cori  
Go to last post Go to first unread
Last post: 4/16/2021 4:05:02 PM(UTC)