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

 
Participant
3 months, 3 weeks ago.

  • Author
    Posts
  • #105227

    Participant
    Points: 55
    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" `
        -Enabled:$true
    }
    
  • #105235

    Keymaster
    Points: 1,625
    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

      Participant
      Points: 55
      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.