mount point report

I am looking for a powershell script to get report of mount points on few server.
Expert out there, Can you please share me he script?
LVL 2
sara2000Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Shaun VermaakTechnical Specialist IVCommented:
Please try
Get-WmiObject Win32_Volume | ForEach {
    New-Object PSObject -Property @{
        Name = $_.Name
        Label = $_.Label
        FreeSpace_GB = ([Math]::Round($_.FreeSpace /1GB,2))
        TotalSize_GB = ([Math]::Round($_.Capacity /1GB,2))
    }
}

Open in new window

0
sara2000Author Commented:
Thank you for this. IS there any way I can email the report .
0
Shaun VermaakTechnical Specialist IVCommented:
$smtpServer = "mailserver01"
$smtpFrom = "anotheraddress@mail.com"
$smtpTo = "someaddress@mail.com"
$messageSubject = "Subject"
 
$message = New-Object System.Net.Mail.MailMessage $smtpfrom, $smtpto
$message.Subject = $messageSubject
$message.IsBodyHTML = $true

$message.Body = Get-WmiObject Win32_Volume | ForEach { New-Object PSObject -Property @{ Name = $_.Name; Label = $_.Label; FreeSpace_GB = ([Math]::Round($_.FreeSpace /1GB,2)) TotalSize_GB = ([Math]::Round($_.Capacity /1GB,2)) }} | ConvertTo-Html

$smtp = New-Object Net.Mail.SmtpClient($smtpServer)
$smtp.Send($message)

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sara2000Author Commented:
Thanks Shaun, I have no experience in scripts , hope you do not mind.  How do I run this remotely (from another server)?
0
Shaun VermaakTechnical Specialist IVCommented:
No problem. Save in PS1 file and run
Invoke-Command -ComputerName ServerName01 -FilePath "C:\Temp\Script.ps1"

Open in new window

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.