Forum Discussion
lior_rays
Dec 20, 2020Copper Contributor
365 atp script
hey everyone first of all sorry for my english , i hope somone can help me
im try to configure an atp policy in my organization .
now my problem is , when i need to set the -recipient domain value
it doesnt give me an option to insert a csv or use on wildcard
I mean the script knew to include in this entry all the existing domain nameslets say i have 3 domain on the same tennent:
domain 1
domain 2
domain 3
i will add my code . and the error i got.
code:
Connect-MsolService -Credential $a
Get-MsolDomain |select name |Export-Csv -Path .\test.csv -NoTypeInformation
$b=Import-Csv
foreach($i in $b){
set-AntiPhishRule -Identity "SecureTest" -RecipientDomainIs $b
}
error:
Cannot process argument transformation on parameter 'RecipientDomainIs'. Cannot convert value "@{Name=http://test1111.onmicrosoft.com/?fbclid=IwAR35lXGUDWfKWFEST8L_YK2M54f58gd_CYsH5wh1CcwI_VmrTbQNART2J64}" to type "Microsoft.Exchange.Data.Word[]". Error: "Cannot convert value
"@{Name=http://test1111.onmicrosoft.com/?fbclid=IwAR23Q56NMgbekQgMLQqNeZFwc1uPHnXBAQqO6wuM_E8Y7XE-Bu0dgKJ0uXQ}" to type "Microsoft.Exchange.Data.Word". Error: "Cannot convert the "@{Name=http://test1111.onmicrosoft.com/?fbclid=IwAR3WAEdzbwNErdnyHt_TD4WV-_dSbuzlN31GoT3fwW5ZERTl7uScI8ikZOk}" value of type "Deserialized.System.Management.Automation.PSCustomObject" to
type "Microsoft.Exchange.Data.Word".""
+ CategoryInfo : InvalidData:
) [Set-AntiPhishRule], ParameterBindin...mationException
+ FullyQualifiedErrorId : ParameterArgumentTransformationError,Set-AntiPhishRule
+ PSComputerName : https://outlook.office365.com/?fbclid=IwAR0rxriADaeUz1ROqEHFP5oO1-DsRcAtmtvAUZ94pO-TNd6ZxWeY9QSqCCQ
i try different option and i dident succesed .
the value properties is:
-RecipientDomainIs.
No RepliesBe the first to reply