Link to home
Start Free TrialLog in
Avatar of ImmanCan
ImmanCan

asked on

Mail Enabled Public Folder

Hi,

I need to create a mail-enabled public folder from a csv file.  The CSV file cotains

Folder,Email
ABC123,test@xxxx.com
XYZABC,tset@xxxx.com

The email address have to be the primary smtp address. And the public folder have to be inside "Client XX" public folder.  Can somebody give me the right powershell command for Exchange 2010? Thanks!
Avatar of SreRaj
SreRaj
Flag of India image

Hi,

Please try the following code. I have put input values into a csv file named FolderList.csv.

$PFList=Import-CSV FolderList.csv
ForEach($PF in $PFList){
	New-PublicFolder -Name $PF.Folder -Path "\Client XX\"
	$FolderName="\Client XX\"+$PF.Folder
	Enable-MailPublicFolder -Identity $FolderName
	Set-MailPublicFolder -Identity $FolderName -PrimaySmtpAddress $PF.Email -EmailAddressPolicyEnabled $False
}

Open in new window

Avatar of ImmanCan
ImmanCan

ASKER

Thanks for the reply... Sorry but I dont know how to run this code... will you be able to guide me?
ASKER CERTIFIED SOLUTION
Avatar of SreRaj
SreRaj
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial