[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1713
  • Last Modified:

How do I script the creation of resource mailboxes/users from a list?

AD Server: Microsoft Windows Server 2003
Mail Server: Exchange Server 2007

I have a list of about 60 conference & training rooms that I need to import into AD/Exchange.  

I would like to script as much of this as possible.  Creation of the disabled user, name, email, password, creation of the resource mailbox, room or equipment, auto accept, capacity, AV/TV/Whiteboard, etc...

Thanks for your time in advance!
0
kblumen
Asked:
kblumen
  • 3
  • 3
1 Solution
 
Jeff_SchertzCommented:
This article is a good primer to using PowerShell cmdlets to create mailboxes in bulk.
http://exchangepedia.com/blog/2006/11/exchange-server-2007-bulk-creation-of.html

And here is an example set of cmdlets I use to create Resource mailboxes from a CSV file containing the attribute values:


$Password=Read-Host "Enter Password" -AsSecureString

Import-CSV im_Resources.csv | foreach {New-Mailbox -Shared -Name $_.displayName -SamAccountName $_.sAMAccountName -Alias $_.mailNickName -UserPrincipalName $_.mail -database "SERVERNAME\Mailbox Database" -org 'contoso.com/Migration/Resources' -Password $Password}

Open in new window

0
 
kblumenAuthor Commented:
Thank you.  
This helps but I cannot seem to figure out how to include custom properties in the CSV/script.  So if my Conference Room has a (ceiling mounted) LCD projector I want the custom property to exist in my CSV/script.

I checked http://technet.microsoft.com/en-us/library/aa997663.aspx but I cannot figure out which would apply for a custom property.  

Also, what if 10 rooms do not have a custom property, 20 rooms have 2 custom properties and the rest had 3 custom properties?
0
 
Jeff_SchertzCommented:
In the CSV import file you would include a column for every attribute you want to import, but objects without values in those would simply be left blank.  This is most easily managed in Excel and then when you save the file in CSV format you'd see repeated commas indicating there is no data in that field to import.

I'm not sure if the CustomAttribute fields are supported by the New-Mailbox cmdlet.  You might need to create the accounts first and then use a different cmdlet or LDIFDE approach to populate the other data after the account is created.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
kblumenAuthor Commented:
In the initial link you provided (down in the comments) the author replies to a user asking the same thing:

"The last paragraph in the post has a link to Microsoft's online documentation for new-mailbox command, which lists all the parameters that you can add. The list includes custom attributes as well as plenty of others."

Do you know what they might be called or do you think he misspoke?


0
 
Jeff_SchertzCommented:
The raw AD attrbiute names are extensionAttribute1 through extensionAttribute15.
0
 
kblumenAuthor Commented:
I am speaking more along the lines of a Mailbox Property.  

So Jeff would you say it is only in the Set-Mailbox cmdlet (http://technet.microsoft.com/en-us/library/bb123981.aspx)
This for example?
 [-ResourceCustom <MultiValuedProperty>]

Would you know how to pass the results of a Get-Mailbox to the Set-Mailbox?
0

Featured Post

Easily manage email signatures in Office 365

Managing email signatures in Office 365 can be a challenging task if you don't have the right tool. CodeTwo Email Signatures for Office 365 will help you implement a unified email signature look, no matter what email client is used by users. Test it for free!

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now