Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/evotecit/o365emailaddresspolicy

O365EmailAddressPolicy PowerShell module replicates Exchange On-Premise functionality when it comes to Email Address Policy allowing cloud-only environments. Office 365 doesn't provide an option to autogenerate email addresses for users. This module enables the creation of email addresses for users based on their first name and last name.
https://github.com/evotecit/o365emailaddresspolicy

exchange exchange-online office365 powershell

Last synced: 2 months ago
JSON representation

O365EmailAddressPolicy PowerShell module replicates Exchange On-Premise functionality when it comes to Email Address Policy allowing cloud-only environments. Office 365 doesn't provide an option to autogenerate email addresses for users. This module enables the creation of email addresses for users based on their first name and last name.

Awesome Lists containing this project

README

        

















# O365EmailAddressPolicy - PowerShell Module

**O365EmailAddressPolicy** PowerShell module replicates Exchange On-Premise functionality when it comes to Email Address Policy allowing cloud-only environments. Office 365 doesn't provide an option to autogenerate email addresses for users. This module enables the creation of email addresses for users based on their first name and last name.

## Installing

Everyone can install this module from **PowerShellGallery** hosted by Microsoft. It's recommended way to work with the module.
Version on **PowershellGallery** is optimized for speed and signed. Using code from **GitHub** is **recommended for development**.

```powershell
Install-Module -Name O365Essentials -AllowClobber -Force
```

Force and AllowClobber aren't necessary, but they do skip errors in case some appear.

## Updating

```powershell
Update-Module -Name O365Essentials
```

That's it. Whenever there's a new version, you run the command, and you can enjoy it. Remember that you may need to close, reopen PowerShell session if you have already used module before updating it.

**The essential thing** is if something works for you on production, keep using it till you test the new version on a test computer. I do changes that may not be big, but big enough that auto-update may break your code. For example, small rename to a parameter and your code stops working! Be responsible!

## Usage

```powershell
# will give [email protected]
Get-EmailAddress -FirstName 'Przemysław' -LastName 'Kłys' -EmailTemplate "%g%[email protected]" -ToLower
```

```powershell
$EmailTemplate = @(
"%g.%[email protected]" # will give [email protected]
"%1g.%[email protected]" # will give [email protected]
"%1g%[email protected]" # will give [email protected]
"%3g.%[email protected]" # will give [email protected]
"%g.%[email protected]" # will give [email protected]
"%[email protected]" # will give [email protected]
)

Get-EmailAddress -FirstName 'Przemysław' -LastName 'Kłys' -EmailTemplate $EmailTemplate -ToLower
```