Advertisement

09.30.2008 at 04:59AM PDT, ID: 23774287
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.8

Want the user names of all folders in all drives in a machine to a file. All security permission users.Of non shared folders.

Asked by bsharath in Scripting Languages, Windows Batch Scripting, VB Script

Tags: , ,

Hi,

Want the user names of all folders in all drives in a machine to a file. All security permission users.

All the shares in my file server are removed and have given shares only to people who have asked for. Now i have say 100 + folders in 5 + drives that are not shared and no one has come for it.
Now each folder when i go to Properties > Security can see a lot of user names. So need these user names into a file.So i can send them mails on they requiring it or can be deleted. So is there a way a scriopt runs on all folders that are not shared and gets the data as this.


Folder Name    Drive Name\Folder Name          Security permissions USer names.

Attached a sample script that does the exact and much more for folders that are shared. But in this case need for NON shares in all drives in the machine.

Regards
SharathStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
SETLOCAL ENABLEDELAYEDEXPANSION
Set FieldDelimiter=,
Set ServerAccessCSV=C:\ShareNTFSPermissionsLog-%ComputerName%.CSV
 
ECHO "Folder Name"%FieldDelimiter%"UNC Path"%FieldDelimiter%"Local drive path"%FieldDelimiter%"Drive Letter"%FieldDelimiter%"Folder Size"%FieldDelimiter%"Number of Root folders"%FieldDelimiter%"Share permission"%FieldDelimiter%"Permission"%FieldDelimiter%"Security permission"%FieldDelimiter%"Permission">"%ServerAccessCSV%"
 
 
for /f "tokens=1 delims=:" %%a in ('rmtshare \\%ComputerName%^| find /v /i "default share" ^| find /v /i "Remote admin" ^| find /v /i "Remote IPC" ^| FIND ":"') DO (
    set Share=%%a
    set Share=!Share:~0,-2!
    For /l %%z in (1,1,30) DO if "!Share:~-1!" == " " Set Share=!Share:~0,-1!
 
    Set Comments=
    FOR /f "tokens=1,*" %%b in ('rmtshare \\%ComputerName%\"!Share!" ^| FIND /i "Remark"') DO Set Comments=%%c
 
 
    FOR /f "tokens=1,*" %%b in ('rmtshare \\%ComputerName%\"!Share!" ^| FIND /i "Path"') DO (
        Set SharePath=%%c
        Set FolderSeparator=
        For /l %%z in (1,1,100) DO (
            if "!SharePath:~-%%z,1!" == "\" Set FolderSeparator=Found
            if "!SharePath:~-%%z!" NEQ "\" IF NOT Defined FolderSeparator Set Folder=!SharePath:~-%%z!
        )
 
        Set SharePerm=
        FOR /f "Tokens=1 delims=: " %%i in ('rmtshare \\%ComputerName%\"!Share!" ^| FIND /i " : "') DO Set SharePerm=!SharePerm!#%%i#
        Set FirstAccount=
        for /f "tokens=*" %%d in ('cacls "%%c" ^| find ":" ^| find /v /i "Creator Owner" ^| FIND /v /i "BUILTIN" ^| FIND /v /i "NT AUTHORITY" ^| FIND /v /i "Special access"') do (
            Set FolderPerm=%%d
            Set FolderPerm=!FolderPerm:%%c =!
            for /f "tokens=1,2,* delims=:\" %%f in ('ECHO !FolderPerm!') do (
                Set Access=%%h
                Set Access=!Access:~-2!
                Set Access=!Access:~0,1!
                Set FolderSharePerm="%FieldDelimiter%"
                ECHO !SharePerm! | FIND /i "%%f\%%g"
                IF NOT ERRORLEVEL 1 FOR /f "Tokens=2,3 delims=\: " %%i in ('rmtshare \\%ComputerName%\"!Share!" ^| FIND /i "%%f\%%g"') DO Set FolderSharePerm=%%i"%FieldDelimiter%"%%j && Set SharePerm=!SharePerm:#%%f\%%g#=!
                IF !FolderSharePerm! == "%FieldDelimiter%" IF "!SharePerm!" NEQ "" (
                    FOR /f "tokens=1 delims=#" %%k in ('echo !SharePerm!') do (
                        If /i "%%k" == "\Everyone" (
                            FOR /f "Tokens=1,2 delims=\: " %%i in ('rmtshare \\%ComputerName%\"!Share!" ^| FIND /i "%%k"') DO Set FolderSharePerm=%%i"%FieldDelimiter%"%%j
                        ) Else (
                            FOR /f "Tokens=2,3 delims=\: " %%i in ('rmtshare \\%ComputerName%\"!Share!" ^| FIND /i "%%k"') DO Set FolderSharePerm=%%i"%FieldDelimiter%"%%j
                        )
     
                        Set SharePerm=!SharePerm:#%%k#=!
                    )
                )
                FOR /f "Tokens=*" %%i in ('dir "\\%ComputerName%\!Share!" /ad /b ^| find /c /v ""') DO Set NoSubFolder=%%i
                FOR /f "Tokens=3 delims= " %%i in ('dir "\\%ComputerName%\!Share!" /s ^| find /i "file(s)"') DO Set FolderSize=%%i
                
                ECHO !FolderSharePerm!
                IF NOT DEFINED FirstAccount (
                    ECHO "!Folder!"%FieldDelimiter%"\\%ComputerName%\!Share!"%FieldDelimiter%"!Comments!"%FieldDelimiter%"!SharePath!"%FieldDelimiter%"!SharePath:~0,1!"%FieldDelimiter%"!FolderSize!"%FieldDelimiter%"!NoSubFolder!"%FieldDelimiter%"!FolderSharePerm!"%FieldDelimiter%"%%g"%FieldDelimiter%"!Access!">>"%ServerAccessCSV%"
                    SET FirstAccount=%%g
                ) ELSE (
                    ECHO ""%FieldDelimiter%""%FieldDelimiter%""%FieldDelimiter%""%FieldDelimiter%""%FieldDelimiter%""%FieldDelimiter%""%FieldDelimiter%"!FolderSharePerm!"%FieldDelimiter%"%%g"%FieldDelimiter%"!Access!">>"%ServerAccessCSV%"
                )
            )
        )
 
:AnotherShare
        IF "!SharePerm!" NEQ "" (
            FOR /f "tokens=1 delims=#" %%k in ('echo !SharePerm!') do (
                If /i "%%k" == "\Everyone" (
                    FOR /f "Tokens=1,2 delims=\: " %%i in ('rmtshare \\%ComputerName%\"!Share!" ^| FIND /i "%%k"') DO Set FolderSharePerm=%%i"%FieldDelimiter%"%%j
                ) Else (
                    FOR /f "Tokens=2,3 delims=\: " %%i in ('rmtshare \\%ComputerName%\"!Share!" ^| FIND /i "%%k"') DO Set FolderSharePerm=%%i"%FieldDelimiter%"%%j
                )
 
                ECHO ""%FieldDelimiter%""%FieldDelimiter%""%FieldDelimiter%""%FieldDelimiter%""%FieldDelimiter%""%FieldDelimiter%""%FieldDelimiter%"!FolderSharePerm!"%FieldDelimiter%""%FieldDelimiter%"">>"%ServerAccessCSV%"
                Set SharePerm=!SharePerm:#%%k#=!
                IF "!SharePerm!" NEQ "" goto :AnotherShare
            )
        )
    )
)
[+][-]09.30.2008 at 07:43AM PDT, ID: 22605817

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.30.2008 at 07:46AM PDT, ID: 22605861

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.30.2008 at 08:14AM PDT, ID: 22606140

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.30.2008 at 08:19AM PDT, ID: 22606198

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.30.2008 at 08:22AM PDT, ID: 22606233

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.30.2008 at 08:30AM PDT, ID: 22606304

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.02.2008 at 11:36AM PDT, ID: 22627111

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.08.2008 at 07:39AM PDT, ID: 22669487

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.08.2008 at 07:46AM PDT, ID: 22669572

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.08.2008 at 07:52AM PDT, ID: 22669649

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.08.2008 at 08:12AM PDT, ID: 22669868

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.08.2008 at 09:23AM PDT, ID: 22670557

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.08.2008 at 09:28AM PDT, ID: 22670596

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.08.2008 at 10:03AM PDT, ID: 22670881

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Scripting Languages, Windows Batch Scripting, VB Script
Tags: Script, Vbs, Bat
Sign Up Now!
Solution Provided By: AmazingTech
Participating Experts: 2
Solution Grade: A
 
 
[+][-]10.08.2008 at 10:23AM PDT, ID: 22671067

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.08.2008 at 10:28AM PDT, ID: 22671105

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.08.2008 at 10:29AM PDT, ID: 22671109

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.08.2008 at 10:31AM PDT, ID: 22671119

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.08.2008 at 10:32AM PDT, ID: 22671132

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.08.2008 at 10:35AM PDT, ID: 22671162

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.08.2008 at 10:38AM PDT, ID: 22671190

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.08.2008 at 10:59AM PDT, ID: 22671383

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.08.2008 at 11:04AM PDT, ID: 22671426

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.08.2008 at 11:12AM PDT, ID: 22671516

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.08.2008 at 11:15AM PDT, ID: 22671556

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.08.2008 at 07:41PM PDT, ID: 22675321

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.08.2008 at 09:11PM PDT, ID: 22675633

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.08.2008 at 09:41PM PDT, ID: 22675730

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.11.2008 at 11:31AM PDT, ID: 22694902

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.14.2008 at 10:43AM PDT, ID: 22713787

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_EXPERT_20070906