locked
Script powershell RRS feed

  • Question

  • Hi all,

    I have to create in my exchange servers 2013 with the command :

    New-Mailbox -Name "XXX-FFFFFFF-PU" -LinkedDomainController "DC1" -LinkedMasterAccount "DC1\FFFFFF" -OrganizationalUnit Users -UserPrincipalName "adresse email" -LinkedCredential:(Get-Credential DC1\FFFFFF)

    but I need to do this for 300 users and I thought I create the txt file with Name, LinkedDomaiController, linkedMasterAccount, organizationUnit, UserPrincipalName

    Can you help me??

    Best regards

    Tuesday, May 13, 2014 8:29 PM

Answers

  • You're looking for the import-csv cmdlet:

    http://technet.microsoft.com/en-us/library/ee176874.aspx

    Create a CSV like

    Name, LinkedDomaiController, linkedMasterAccount, organizationUnit, UserPrincipalName
    "XXX-FFFFFFF-PU",DC1,"DC1\FFFFFF","Users","adresse email

    Then use $_.Name and $_.linkedMasterAccount in your loop.


    Please remember, if you see a post that helped you please click "Vote As Helpful" and if it answered your question please click "Mark As Answer". SWC Unified Communications

    Tuesday, May 13, 2014 9:58 PM