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

Applying GPO to OWA feature when creating new mailboxes in Power Shell

$
0
0

Hello all,

I'm a super rookie with Power Shell and would appreciate a little assistance. I have a script that will create mailboxes from a CSV file and it works fine but there are a few things I don't know how to apply when creating the accounts.

1. Applying my GPO to OWA in Mailbox Features

2. Selecting the mailbox DB the user will be placed in.

This is what I have so far:

Import-Csv c:\Scripts\Myfile.csv | ForEach-Object {

 $password = ConvertTo-SecureString $_.Password -AsPlainText -Force
   
 New-Mailbox -Name $_.Name `
    -FirstName $_.FirstName `
    -LastName $_.LastName `
    -Alias $_.SamAccountName `
    -UserPrincipalName $_.UserPrincipalName `
    -Password $password `
    -ResetPasswordOnNextlogon $False `
    -OrganizationalUnit mydomain.com/Users

}

Any help would be appreciated. Thanks!


Viewing all articles
Browse latest Browse all 21975

Trending Articles



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