Mukul Gautam
asked on
How to check Hyper-v core server disk space without loggin into the server
Please share the process to check hyper-v disk space on core server without logged into the server, as one of our Hyper-v core server is connected via VMM but not able to take RDP.
You can use this Get-RemoteComputerDisk PowerShell function
<#
.Synopsis
Gets Disk Space of the given remote computer name
.DESCRIPTION
Get-RemoteComputerDisk cmdlet gets the used, free and total space with the drive name.
.EXAMPLE
Get-RemoteComputerDisk -RemoteComputerName "abc.contoso.com"
Drive UsedSpace(in GB) FreeSpace(in GB) TotalSpace(in GB)
C 75 52 127
D 28 372 400
.INPUTS
Inputs to this cmdlet (if any)
.OUTPUTS
Output from this cmdlet (if any)
.NOTES
General notes
.COMPONENT
The component this cmdlet belongs to
.ROLE
The role this cmdlet belongs to
.FUNCTIONALITY
The functionality that best describes this cmdlet
#>
function Get-RemoteComputerDisk
{
Param
(
$RemoteComputerName
)
Begin
{
$output="Drive `t UsedSpace(in GB) `t FreeSpace(in GB) `t TotalSpace(in GB) `n"
}
Process
{
$drives=Get-WmiObject Win32_LogicalDisk -ComputerName $RemoteComputerName
foreach ($drive in $drives){
$drivename=$drive.DeviceID
$freespace=[int]($drive.FreeSpace/1GB)
$totalspace=[int]($drive.Size/1GB)
$usedspace=$totalspace - $freespace
$output=$output+$drivename+"`t`t"+$usedspace+"`t`t`t`t`t`t"+$freespace+"`t`t`t`t`t`t"+$totalspace+"`n"
}
}
End
{
return $output
}
}
https://gallery.technet.microsoft.com/PowerShell-Script-to-Get-b6ca4350
We always set the Windows Firewall for Remote Volume Management to ENABLED via Group Policy.
Then, using MMC --> New Snap-In --> Computer --> Another Computer --> SERVER NAME
Open the Disk Management node and the information will be there.
Then, using MMC --> New Snap-In --> Computer --> Another Computer --> SERVER NAME
Open the Disk Management node and the information will be there.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
in command prompt put:
dir \\servername\c$
or by IP
dir \\xxx.xxx.xxx.xxx\C$