Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

enabling mailbox

$
0
0

How do i incorporate enable-mailbox to the code listed below

the e-mail has to be in the format of firstname.lastname@none.com

$users = Import-CSV .\blkusr.csv 
$Users | Foreach-Object {
$UserPrincipalName = $_.id + "@nonenet.com" 

New-ADUser -GivenName $_.Name -Surname $_.Last -DisplayName $_.DispName -SamAccountName $_.Id -OfficePhone $_.OfficePh -Name $_.DispName -EmailAddress $_.Email -Company $_.Company -Country $_.Country -AccountExpirationDate "03/01/2015 5:00:00 PM" -Office $_.Office -AccountPassword $(ConvertTo-SecureString $_.Password -AsPlainText -Force) -UserPrincipalName $UserPrincipalName -ChangePasswordAtLogon $True -Path "OU=Users,OU=AT,OU=bee2,DC=nONENET,DC=COM" -OtherAttributes @{'info'="Preferred Language: English [en]"} -Enabled $true


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>