Written code to lookup physcialDeliveryOfficeName to set dial plan for Skype users in FIM based on their location. We have the import script working to do the lookup and compare. We do not use FIM Portal and are getting error on export script attempting to update dialplan getting error MA-Extension-error 0x80230825. Here is snip of the code - Any thoughts?
param
(
$username="",
$password=""
)
begin
{
import-modulelync
}
process
{
$error.clear()
$errorstatus="success"
$errordetails=""
$identifier=$_."[Identifier]"
$anchor=$_."[Anchor]"
$samaccountname=$_.accountName
$physicalDeliveryOfficeName=$_.physicalDeliveryOfficeName
$SkypeDialPlan=$_.SkypeDialPlan
$objectmodificationtype=$_."[ObjectModificationType]"
$objectguid=$_.objectguid
$changedattrs=$_.'[ChangedAttributeNames]'
[bool]$SkypeUserEnabled=$_.SkypeUserEnabled
$_ |out-filec:\psma\dump\$samaccountname.txt
try
{
foreach ($canin$_.ChangedAttributeNames)
{
$can
foreach ($ValueChangein$_.AttributeChanges[$can].ValueChanges)
{
if ($can-eq'physicalDeliveryOfficeName')
{if ($objectmodificationtype-match'Replace')
{
#physicalDeliveryOfficeName has changed and we need to update the dialplan
Grant-CsDialPlan-Identity$_.sipaddress-PolicyName$_.SkypeDPLookup
}
}
}
}