Hi all,
I'm trying to write a maintenance script for our Exchange mailbox servers that will run after we have performed maintenance on the servers hosted some iSCSI storage and we can resume database copies to those servers. I already have a script that will suspend all databases hosted on the storage but I'm struggling with with my PowerShell command to resume the copies and wondered if somebody could help.
The script I have written is as follows:
Get-MailboxDatabaseCopyStatus -server Server1 | where {$_.status -eq "Suspended" -And $_.name -like "Archive*"} | ForEach {
$dbname=Get-MailboxDatabaseCopyStatus $_
Resume-MailboxDatabaseCopy -Identity "$dbname\Server1"
}
I know my issue is that I am using a different cmdlet for my origional query (which identifies the correct mailbox copies) but the fact I then name attempting to use a different cmdlet in the ForEach loop means the value doesnt get passed to the variable correctly but I'm not sure how to correct this.
I'm a willing student so I would appreciate it if anybody could help and expalin to me where I am going wrong!
Thanks in advance