Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Setup file integrity on a full volume
- Get-ChildItem R: -Recurse | select fullname | Set-FileIntegrity -enable $True
- # Setup file integrity on a single file
- Set-FileIntegrity R:\test -enable $True
- # Setup file integrity on a directory
- Get-ChildItem R:\test -recurse | select fullname | Set-FileIntegrity -enable $True
- # Get file integrity settings for a file
- Get-FileIntegrity 'R:\test\diag\localhost\OperationalLog.evtx'
- # Repair file integrity for a file (this seems to be broken?)
- Repair-FileIntegrity 'R:\test\diag\localhost\OperationalLog.evtx'
- # Get Various info on a Storage Space Pool
- get-volume -driveletter r | get-storagepool
- get-volume -driveletter r | get-storagepool | Out-gridview
- get-volume -driveletter r | get-storagepool | select friendlyname, isreadonly, name, resiliencysettingnamedefault,size,healthstatus,operationalstatus,repairpolicy
- get-volume -driveletter r | Get-VolumeScrubPolicy
- # Optimize volume (including underlying physical disks)
- Optimize-Volume -DriveLetter R -Verbose -Analyze
- # Optimize storage pool (this seems like it's a proper scrub...)
- get-volume -driveletter r | get-storagepool | Optimize-StoragePool
- # Volume Corruption stuff
- Get-VolumeCorruptionCount r # Doesn't seem to apply to ReFS
- repair-volume -driveletter r # Doesn't apply to ReFS
- Repair-Volume -DriveLetter R -Scan # Doesn't apply to ReFS
- # Paw through system event log looking for error messages / warnings
- $TempSystemLog = (Get-WinEvent -LogName System)
- $TempSystemLog | group { $_.providername } | select name
- $TempSystemLog | Where-object {$_.ProviderName -eq "Disk"}
- $TempSystemLog | Where-object {$_.ProviderName -eq "Virtual Disk Service"}
- $TempSystemLog | Where-object {$_.ProviderName -eq "NTFS"}
- $TempSystemLog | Where-object {$_.ProviderName -eq "ReFS"}
- $TempSystemLog | Where-object {$_.ProviderName -eq "Microsoft-Windows-Ntfs"}
- $TempSystemLog | Where-object {$_.ProviderName -eq "Microsoft-Windows-Refs"}
- # Get various info on disks in a Storage Space Pool
- get-volume -driveletter r | get-storagepool | Get-PhysicalDisk | Get-StorageReliabilityCounter
- get-volume -driveletter r | get-storagepool | Get-PhysicalDisk | Get-StorageAdvancedProperty
- Get-VirtualDisk -FriendlyName 'Travel' | Get-PhysicalDisk
- Get-VirtualDisk -FriendlyName 'Travel' | Get-PhysicalDisk | Enable-StorageMaintenanceMode
- Get-VirtualDisk -FriendlyName 'Travel' | Get-PhysicalDisk | Disable-StorageMaintenanceMode
- Get-VirtualDisk -FriendlyName 'Travel' | get-storagetier
- Get-VirtualDisk -FriendlyName 'Travel' | Get-StorageSubSystem
- Get-VirtualDisk -FriendlyName 'Travel' | Get-StorageSubSystem | Get-StorageDiagnosticInfo
- # Look for unhealthy pools and which disks are 'bad'
- $storagePools = Get-StoragePool
- foreach($pool in $storagePools){
- if($pool.HealthStatus -ne "Healthy" -and $pool.IsPrimordial -ne "True"){
- $physicalDisks = $pool | Get-PhysicalDisk |
- Select FriendlyName, Manufacturer, Model, SerialNumber, OperationalStatus, HealthStatus, Usage, Size
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement