-2

I am generating a report where I need to find which servers has mountpoints configured on it.. can you help how to get that infor using WMI or powershell.

I mean I need to identify the servers, if mountpoints exists in it.. and also their names....

user523917
  • 3
  • 1
  • 8
  • Hi Graham and all thanks for replying.. I know about win32_volume, and win32_logicaldisk and classes under MScluster namespace.. but i need some guidance (I am a DBA).. on how to identify a mountpoint...in a server... that whether the sever has mountpoint on it or direct mounted volumes... – user523917 Feb 02 '14 at 17:00
  • By mountpoints do you mean mapped drives e.g \\server\share1 mapped to a drive letter e.g. d:\ ? Something like the answer from @FrodeF. would be along the right lines. You won't get a full script from someone one StackOverflow, you're expected to have gone someway towards a solution already and show your code/data. – Graham Gold Feb 02 '14 at 17:45

1 Answers1

1

Get a list of all servers from textfile, AD, etc. and run a foreach loop with something like this:

Get-Wmiobject -query “select name,driveletter,freespace from win32_volume where drivetype=3 AND driveletter=NULL” -computer servername

A quick google search for "windows mount point wmi" would return THIS (source).

Then export the results to CSV, HTML or whatever you need. Your question is lacking a lot of details and any sign of effort from your part, so I can't/won't go any further.

UPDATE: Does this help? It lists mount points(folder paths, not driveletters).

$servers = @("server1","server2","server3","server4","server5")

$servers | % {
    $mountpoints = @(Get-WmiObject Win32_MountPoint -ComputerName $_ | Select-Object -ExpandProperty Directory | ? { $_ -match 'Win32_Directory.Name="(\w:\\\\.+)"' }) | % { [regex]::Match($_,'Win32_Directory.Name="(\w:\\\\.+)"').Groups[1].Value -replace '\\\\', '\' }

    if($mountpoints.Count -gt 0) {
        New-Object psobject -Property @{
            Server = $_
            MountPoints = $mountpoints
            }
    }
}

Server     MountPoints
------     -----------
{server1} {D:\SSD, C:\Test}
Frode F.
  • 52,376
  • 9
  • 98
  • 114
  • K.. let me phrase it this way.. I got 5 servers, out of which 3 server has mountpoints and two dont.. now i need to query the wmi to get those mountpoint name (not the disks info underneath it).....I mean how to identify the mountpoint is there any unique way to identify them.. – user523917 Feb 02 '14 at 16:57