0

I am trying to Export the alerts of a site and import them to another using Powershell.

It is working perfectly except filters. They are not getting applied.

Any ideas, please.

script attached :

NOTE : All the items I am picking form csv.

    $user = $web.EnsureUser($item.User)
    $alert = $user.Alerts.Add()
    $alert.Title = $item.Title
    $alert.DeliveryChannels = $item.DeliveryChannel
    $alert.EventType = $item.EventType
    $alert.AlertFrequency = $item.Frequency
    if($item.AlertType -eq "List")
    {
        $alert.AlertType = $item.AlertType  
        $alert.List = $web.Lists[$item.List]
    }
    elseif($item.AlertType -eq "Item")
    {
        $alert.AlertType = $item.AlertType
        $list = $web.Lists[$item.List]
        $item = $list.Items.GetItemById($item.Item)
        $alert.Item = $item
    }
    $alert.Filter=$item.Filter 
    $alert.Update()
  • Please share your current tries (PowerShell script) to can help you faster! – Mohamed El-Qassas MVP Mar 22 '18 at 11:06
  • @MohamedEl-QassasMVP script is updated . – notorious Mar 22 '18 at 11:20
  • @MohamedEl-QassasMVP script is updated. – notorious Mar 23 '18 at 9:12
  • Sorry bro, let me check it – Mohamed El-Qassas MVP Mar 23 '18 at 9:50
  • Just in case any progress @MohamedEl-QassasMVP – notorious Mar 27 '18 at 20:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.