Advertisement
private775

SP: PS update calendar overlays after backup/restore move

Sep 30th, 2015
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $orig = "http://acmeprd/schedule"
  2. $dest = "http://acmedev/schedule"
  3.  
  4. $web = get-spweb $dest
  5.  
  6. $cal = $web.Lists["Room Schedule"]
  7. $views = $cal.Views|%{$_}
  8. foreach($v in $views){
  9.     if($v.CalendarSettings -ne $null -and $v.CalendarSettings -match $orig){
  10.         $v.Title
  11.         $v.CalendarSettings = $v.CalendarSettings.Replace($orig, $dest)
  12.         $v.Update()
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement