Hi,
I have a csv file as follows,
"mailbox","Deliver","forwardto"
"test1@domain.com","True","test1@yahoo.com"
"test2@domain.com","False","test2@hotmail.com"
mailbox and forwardto addresses are already created in environment.
I need to set test1@domain.com mailboxes "DeliverToMAilboxAndForward" setting from CSV
When I try do do it with import-csv | foreach {set-mailbox ....I get the error below,
Cannot process argument transformation on parameter 'DeliverToMailboxAndForward'. Cannot convert value "System.String"
to type "System.Boolean", parameters of this type only accept booleans or numbers, use $true, $false, 1 or 0 instead.
+ CategoryInfo : InvalidData: (:) [Set-Mailbox], ParameterBindin...mationException
+ FullyQualifiedErrorId : ParameterArgumentTransformationError,Set-Mailbox
How can I convert TRUE and FALSE strings to System.Boolean in my script?