Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 486 Vote(s) - 3.56 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get disk capacity and free space of remote computer

#11
I know of psExec tools which you can download from [here][1]


There comes a psinfo.exe from the tools package. The basic usage is in the following manner in powershell/cmd.

[![enter image description here][2]][2]


[1]:

[To see links please register here]

[2]:



However you could have a lot of options with it

Usage: psinfo [[\\computer[,computer[,..] | @file [-u user
[-p psswd]]] [-h] [-s] [-d] [-c [-t delimiter]] [filter]

\\computer Perform the command on the remote computer or computers specified. If you omit the computer name the command runs on the local system, and if you specify a wildcard (\\*), the command runs on all computers in the current domain.

@file Run the command on each computer listed in the text file specified.
-u Specifies optional user name for login to remote computer.
-p Specifies optional password for user name. If you omit this you will be prompted to enter a hidden password.
-h Show list of installed hotfixes.
-s Show list of installed applications.
-d Show disk volume information.
-c Print in CSV format.
-t The default delimiter for the -c option is a comma, but can be overriden with the specified character.

filter Psinfo will only show data for the field matching the filter. e.g. "psinfo service" lists only the service pack field.
Reply

#12
Get-PSDrive C | Select-Object @{ E={$_.Used/1GB}; L='Used' }, @{ E={$_.Free/1GB}; L='Free' }
Reply

#13
Just one command simple sweet and clean but this only works for local disks

Get-PSDrive
[![enter image description here][1]][1]


[1]:


You could still use this command on a remote server by doing a Enter-PSSession -Computername ServerName and then run the Get-PSDrive it will pull the data as if you ran it from the server.
Reply

#14
In case you want to check multiple drive letters and/or filter between local and network drives, you can use PowerShell to take advantage of the [Win32_LogicalDisk WMI][1] class. Here's a quick example:

$localVolumes = Get-WMIObject win32_volume;

foreach ($vol in $localVolumes) {
if ($vol.DriveLetter -ne $null ) {
$d = $vol.DriveLetter[0];
if ($vol.DriveType -eq 3) {
Write-Host ("Drive " + $d + " is a Local Drive");
}
elseif ($vol.DriveType -eq 4) {
Write-Host ("Drive" + $d + " is a Network Drive");
}
else {
// ... and so on
}

$drive = Get-PSDrive $d;
Write-Host ("Used space on drive " + $d + ": " + $drive.Used + " bytes. `r`n");
Write-Host ("Free space on drive " + $d + ": " + $drive.Free + " bytes. `r`n");
}
}

I used the above technique to create a Powershell script that checks all drives and send an e-mail alert whenever they go below a user-defined quota. You can get it from [this post][2] on my blog.

[1]:

[To see links please register here]

[2]:

[To see links please register here]

Reply

#15
PowerShell Fun

Get-WmiObject win32_logicaldisk -Computername <ServerName> -Credential $(get-credential) | Select DeviceID,VolumeName,FreeSpace,Size | where {$_.DeviceID -eq "C:"}
Reply

#16
Just found [Get-Volume][1] command, which returns `SizeRemaining`, so something like `(Get-Volume -DriveLetter C).SizeRemaining / (1e+9)` can be used to see remained Gb for disk C. Seems works faster than `Get-WmiObject Win32_LogicalDisk`.


[1]:

[To see links please register here]

Reply

#17
On PowerShell:

"FreeSpace C: " + [math]::Round((Get-Volume -DriveLetter C).SizeRemaining / 1Gb) + " GB"


Reply

#18
`"FreeSpace C: {0:n3} GB" -f ((Get-Volume -DriveLetter C).SizeRemaining / 1Gb)`
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through