Bulk user creation; otherMailbox

Welcome Forums General PowerShell Q&A Bulk user creation; otherMailbox

This topic contains 2 replies, has 2 voices, and was last updated by

7 months ago.

  • Author
  • #105227

    Points: 71
    Rank: Member

    I have a csv setup to add users to a test domain but don't know how to populate the otherMailbox attribute

    $secpass = Read-Host "Password" -AsSecureString 
    Import-Csv SVCAccounts.csv |
    foreach {
      $name = "$($_.DisplayName)"
     New-ADUser -Name $name -DisplayName $($_.DisplayName) `
        -SamAccountName $($_.SamAccountName) `
        -Department $($_.Department) `
        -Description $($_.Description) `
        -EmailAddress $($_.mail) `
        -???? @{otherMailbox=$_.OtherMailbox}`
        -AccountPassword $secpass -Path "OU=_Test,OU=ServiceAccts,OU=UserAccts,DC=corp,DC=com" `
  • #105235

    Points: 1,811
    Helping HandTeam Member
    Rank: Community Hero

    Read the help for New-ADUser; it has a generic -OtherAttributes parameter, which you use to populate attributes that don't have their own dedicated parameters. The help (https://docs.microsoft.com/en-us/powershell/module/addsadministration/new-aduser?view=win10-ps) includes examples for using it.

    • #105244

      Points: 71
      Rank: Member

      Thanks Don,

      I had read that help item earlier but clearly needed to re-visit it again to get it formatted correctly, and working.

      -OtherAttributes @{'otherMailbox'=$($_.OtherMailbox)} `

The topic ‘Bulk user creation; otherMailbox’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort