header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
passing variable to recipientfilter not working
Last Post 15 Jul 2010 03:50 AM by Kieran Kennedy. 1 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Kieran KennedyUser is Offline
New Member
New Member
Posts:2
Avatar

--
14 Jul 2010 07:36 AM
    I have this small piece of script to create a dynamicdistributionlist and set one of the custom fields
    CSV file is
    title,year
    Group1,1


    $GroupFile = import-csv .\groups.csv -OutVariable string
    foreach ($Group in $GroupFile)
    {
     $GroupName = $group.title
     $GroupYear = $group.year
     Echo "Adding $GroupName"
     New-DynamicDistributionGroup -Name $GroupName -RecipientFilter{(Recipienttype -eq "UserMailbox") -and (Title -eq $GroupName)}
     Set-DynamicdistributionGroup $GroupName -CustomAttribute1 $GroupYear
     }

    As you can see below the $GroupName variable is not being passed for the Title filter

    ((RecipientType -eq 'UserMailbox' -and -not(Title -ne $null)) -and -not(Name -
    like 'SystemMailbox{*') -and -not(Name -like 'CAS_{*') -and -not(RecipientType
    DetailsValue -eq 'MailboxPlan') -and -not(RecipientTypeDetailsValue -eq 'Arbit
    rationMailbox'))

    Any suggentions?
    Thanks
    Kieran
    Kieran KennedyUser is Offline
    New Member
    New Member
    Posts:2
    Avatar

    --
    15 Jul 2010 03:50 AM
    Found the answer
    New-DynamicDistributionGroup -Name $GroupName -RecipientFilter{(Recipienttype -eq "UserMailbox") -and (Title -eq $GroupName)}
    Changed to
    New-DynamicDistributionGroup -Name $GroupName -RecipientFilter"Recipienttype -eq 'UserMailbox' -and Title -eq '$GroupName'"

    You are not authorized to post a reply.


    Active Forums 4.3
    right
    footer   footer
    footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
    footer   footer