Within PowerShell 4.0 I'd like to export the servers network mappings and the assigned group permissions.

Hello,

Within PowerShell 4.0 I'd like to export the servers network mappings and determine the assigned group permissions. The first part is the drive mappings and afterward I'll tackle the permissions. I'd like to reference servers.txt to find the servers and export all drive mapping details. Any thoughts?

=======================================================================
#
# NAME: Get-MappedDrives.ps1
#
# Modified: Medical Inc IT Staff
# Date: 17-Mar-2015
# Verison: PowerShell 4.0
# Client OS: Windows 7
# Server OS: Windows 2008 R2
#
# Description: Retrieve Workstations Drive Mappings
#
# To run the script
#
# .\Get-MappedDrives.ps1
#
#
##############################################################
$computerlist = "Get-Content C:\Scripts\Servers.txt"
$namespace = "root\CIMV2"

ForEach ($computer in $computerlist)
{
$Result1 = Get-wmiobject Win32_ComputerSystem -computer $computer | select username
$Result2 = Get-WmiObject -class Win32_NetworkConnection -computername $computer -namespace $namespace |  select logicaldisk
      $Result += $Result1, $Result2 | %{Add-Content "C:\Scripts\$computer.txt" $_}
}
CuriousMAUserAsked:
Who is Participating?
 
Tony MassaCommented:
You want to use a list of servers and export the shares and permissions on the shared folders?

Something like this?:  https://gallery.technet.microsoft.com/scriptcenter/Lists-all-the-shared-5ebb395a
0
 
CuriousMAUserAuthor Commented:
Thank you, a helpful link.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.