I'm trying to put a scheduled task script together that will UnManage some volumes for a period of time but I'm getting strange results.
I'm using the same code that I would use for unmanaging nodes but when I use it on volumes the UnMangeUntil time adds 15 hours. I've tried it on Get-Date with my local time and with (Get-Date).ToUniversalTime() but get strange results either way. Below is the code snippet:
---------------------------------------------------
[datetime]$unmanage_from = Get-Date
[datetime]$unmanage_until = (Get-Date).AddMinutes(90)
$unmanage_from_UTC = $unmanage_from.ToUniversalTime()
$unmanage_until_UTC = $unmanage_until.ToUniversalTime()
# Query SWIS
$volumeid = Get-SwisData $swis "SELECT VolumeID FROM Orion.Volumes WHERE NodeID = 3859 AND Caption = '/var'"
# UnManage Volume
Invoke-SwisVerb $swis Orion.Volumes Unmanage @("V: $volumeid ",$unmanage_from_UTC ,$unmanage_until_UTC , "true")
---------------------------------------------------
I've tried it with just the first Get-Date, with and without [datetime] and then I added the ToUniversalTime to see what would happen but had no luck there either.
Any help is greatly appreciated
Michael