2009/06/16

Fixing space in Public Folder name issue in Excahnge 2007 built-in scripts

CURRENT CONFIGURATION: Exchange 2007 Standard with Public folders

OBJECTIVE: Remove or add user permissions from or to Exchange Public folder and all folders under it (recursive) with Exchange built-in PowerShell scripts RemoveUserFromPFRecursive.ps1 and AddUsersToPFRecursive.ps1.

ISSUE: Scripts RemoveUserFromPFRecursive.ps1 and AddUsersToPFRecursive.ps1 don't work if Exchange Public Folder name contains space(s).

SOLUTION:
Create vbackup copy of original RemoveUserFromPFRecursive.ps1 and AddUsersToPFRecursive.ps1 scripts.

In scripts RemoveUserFromPFRecursive.ps1 and AddUsersToPFRecursive.ps1

find
"get-publicfolder -identity $TopPublicFolder -Recurse -resultsize unlimited"
replace by
#Fixing name with space problem:
'get-publicfolder -identity "$TopPublicFolder"-Recurse -resultsize unlimited'

find
$permission | remove-PublicFolderClientPermission -identity $_.Identity -server $_.OriginatingServer
replace by
#Fixing confirmation problem
$permission | remove-PublicFolderClientPermission -identity $_.Identity -server $_.OriginatingServer -Confirm:$false

DOWNLOAD:
Download AddUsersToPFRecursive_vz.zip md5: 2bc7416556e60958b25a4d9f9648111f
Download RemoveUserFromPFRecursive_vz.zip md5: f247fd6c7951309b9b8d0d0e4b37dff0

2 комментария:

Анонимный комментирует...

Much appreciated. You saved me a few minutes!

Анонимный комментирует...

Than you mate you saved heaps of time and effort ...your a legend