This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

UnManage Volumes using "Invoke-Swisverb $swis Orion.Volumes Unmanage"

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