hi<\/p>\n
i have been using the below script (hobbled together by other peoples work, not mine)<\/p>\n
and it would be perfect if i could extend it to only show shares that have used Everyone to assign rights<\/p>\n
any ideas ?<\/p>\n
mal<\/p>\n
# Add powershell modules for Active Directory\nimport-module activedirectory;\n\n# Get list of servers from Active Directory\n$servers = get-adcomputer -filter {operatingsystem -like \"*server*\"} | where {$_.enabled -eq $true};\n\n# Loop through each server found\nforeach ($server in $servers) {\n\n # Check if server can be pinged\n if(test-connection -cn $server.name -quiet -count 1) {\n\n # Output to screen the name of the server\n write-host \"-------------\";\n write-host $server.name;\n write-host \"-------------\";\n\n # Get the list of shared folders\n $shares = gwmi win32_share -computer $server.name;\n\n # Loop through each shared folder found\n foreach ($share in $shares) {\n\n # Exclude default drive shares, other system default shares and printers\n if (($share.name -ne \"print$\") -and ($share.path -notlike \"*LocalsplOnly*\") -and ($share.name -notmatch \".\\$\") -and ($share.name -ne \"ipc$\") -and ($share.name -ne \"sysvol\") -and ($share.name -ne \"netlogon\")-and ($share.name -ne \"admin$\")) {\n\n # Output to screen the name and path of the shared folder\n # write-host $share.name $share.path;\n $out = $server.name + \",\" + $share.name + \",\" + $share.path\n $out >> C:\\reports\\shares.csv\n }\n\n }\n\n write-host \"\";\n\n }\n}\n<\/code><\/pre>","upvoteCount":5,"answerCount":3,"datePublished":"2021-07-19T13:58:36.000Z","author":{"@type":"Person","name":"malraff","url":"https://community.spiceworks.com/u/malraff"},"suggestedAnswer":[{"@type":"Answer","text":"hi<\/p>\n
i have been using the below script (hobbled together by other peoples work, not mine)<\/p>\n
and it would be perfect if i could extend it to only show shares that have used Everyone to assign rights<\/p>\n
any ideas ?<\/p>\n
mal<\/p>\n
# Add powershell modules for Active Directory\nimport-module activedirectory;\n\n# Get list of servers from Active Directory\n$servers = get-adcomputer -filter {operatingsystem -like \"*server*\"} | where {$_.enabled -eq $true};\n\n# Loop through each server found\nforeach ($server in $servers) {\n\n # Check if server can be pinged\n if(test-connection -cn $server.name -quiet -count 1) {\n\n # Output to screen the name of the server\n write-host \"-------------\";\n write-host $server.name;\n write-host \"-------------\";\n\n # Get the list of shared folders\n $shares = gwmi win32_share -computer $server.name;\n\n # Loop through each shared folder found\n foreach ($share in $shares) {\n\n # Exclude default drive shares, other system default shares and printers\n if (($share.name -ne \"print$\") -and ($share.path -notlike \"*LocalsplOnly*\") -and ($share.name -notmatch \".\\$\") -and ($share.name -ne \"ipc$\") -and ($share.name -ne \"sysvol\") -and ($share.name -ne \"netlogon\")-and ($share.name -ne \"admin$\")) {\n\n # Output to screen the name and path of the shared folder\n # write-host $share.name $share.path;\n $out = $server.name + \",\" + $share.name + \",\" + $share.path\n $out >> C:\\reports\\shares.csv\n }\n\n }\n\n write-host \"\";\n\n }\n}\n<\/code><\/pre>","upvoteCount":5,"datePublished":"2021-07-19T13:58:37.000Z","url":"https://community.spiceworks.com/t/extend-ps-script-for-everyone-shares/805910/1","author":{"@type":"Person","name":"malraff","url":"https://community.spiceworks.com/u/malraff"}},{"@type":"Answer","text":"Welcome<\/p>\n
If you post code, please use the ‘Insert Code’ button. Please and thank you!<\/p>\n