Initial Commit
This commit is contained in:
commit
5c7cfda48e
8 changed files with 119 additions and 0 deletions
20
check-free-space/Check-Free-Space.ps1
Executable file
20
check-free-space/Check-Free-Space.ps1
Executable file
|
@ -0,0 +1,20 @@
|
|||
$servers = @("HOSTNAME")
|
||||
|
||||
Foreach ($server in $servers)
|
||||
{
|
||||
$disks = Get-WmiObject Win32_LogicalDisk -ComputerName $server -Filter DriveType=3 |
|
||||
Select-Object DeviceID,
|
||||
@{'Name'='Size'; 'Expression'={[math]::truncate($_.size / 1GB)}},
|
||||
@{'Name'='Freespace'; 'Expression'={[math]::truncate($_.freespace / 1GB)}}
|
||||
|
||||
$server
|
||||
|
||||
foreach ($disk in $disks)
|
||||
{
|
||||
$disk.DeviceID + $disk.FreeSpace.ToString("N0") + "GB / " + $disk.Size.ToString("N0") + "GB"
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
# /Update on Dec 9, 2019/
|
||||
# Note that moving forward, future PowerShell versions no longer support Get-WmiObject so if all of a sudden you see the error message like “RPC Server is unavailable”, it’s probably time to switch over to Get-CimInstance instead. The parameters are the same for Win32_LogicalDisk. Simply replace Get-WmiObject with Get-CimInstance and you are good to go.
|
29
check-free-space/README.md
Executable file
29
check-free-space/README.md
Executable file
|
@ -0,0 +1,29 @@
|
|||
# Check Free Space PS Script v22.01.1
|
||||
|
||||
Check Free Space is a PowerShell script that allows AD Admins to check the used/max HDD space on all drives on a remote PC on the domain.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before you begin, ensure you have met the following requirements:
|
||||
* PowerShell with the [ActiveDirectory](https://docs.microsoft.com/en-us/powershell/module/activedirectory/?view=windowsserver2022-ps) module installed (Windows only).
|
||||
* Proper permissions granted by your Admin.
|
||||
|
||||
## Installing Check Free Space
|
||||
|
||||
To install Check Free Space, follow these steps:
|
||||
|
||||
* Download the release Source code and place the contents into folder at a location of your choosing.
|
||||
|
||||
## Using Check Free Space
|
||||
|
||||
To use Check Free Space, follow these steps:
|
||||
|
||||
```
|
||||
- Open the script in a notepad program
|
||||
- Enter the hostname of the target PC in the "HOSTNAME" field, replacing the word already there
|
||||
- Save the file
|
||||
- Run the script in PowerShell
|
||||
- The results will be printed out in the terminal
|
||||
```
|
||||
|
||||
This project uses the following license: [Unlicense](https://unlicense.org).
|
3
check-free-space/ROADMAP.md
Executable file
3
check-free-space/ROADMAP.md
Executable file
|
@ -0,0 +1,3 @@
|
|||
# Roadmap
|
||||
|
||||
* N/A
|
Loading…
Add table
Add a link
Reference in a new issue