I currently use DISKSHADOW
to remove shadow copies from our Hyper-V servers. To do this I have to log onto the server but psexec
doesn't work.
psexec \\hyper-v-server diskshadow
DISKSHADOW> Error reading from console. Win32 error: 0x6
The handle is invalid.
I think vssadmin
works doing the above, but I'd like to script this with PowerShell and slectively remove the shadow copies. Neither of these tools provide usable output in PowerShell.
I've done a bit of research but not found any way to query snapshots with PowerShell, either locally or remotely. I imagine doing this will involve use of the Get-WMIObject
CMDlet to query the relevant info from WMI, but I can only find the Win32_ShadowCopy.Create()
method.
EDIT: To be clear, what I would like are objects I can manipulate using PowerShell.