Maintain control of your Microsoft Office 365 data
Post Reply
Joffrey
Novice
Posts: 3
Liked: never
Joined: Sep 10, 2020 8:19 am
Contact:

Organization creation automation

Post by Joffrey »

Hi,

I would like to automate the full process of Organization creation
I must use the Powershell cmdlet 'Add-VBOOrganization', but I think there are some missing step in the Veeam help center about ApplicationId création.
Can ou help me ? Thanks you

nielsengelen
Veeam Software
Posts: 3595
Liked: 712 times
Joined: Jul 15, 2013 11:09 am
Full Name: Niels Engelen
Contact:

Re: Organization creation automation

Post by nielsengelen »

https://foonet.be

Joffrey
Novice
Posts: 3
Liked: never
Joined: Sep 10, 2020 8:19 am
Contact:

Re: Organization creation automation

Post by Joffrey »

hmm.. really ? All commands need an ApplicationID, I don't understand how create this in PS1
The Goal is to write an Ansible playbook (MFA link will be send to Teams or mail.) to configure Tenant

nielsengelen
Veeam Software
Posts: 3595
Liked: 712 times
Joined: Jul 15, 2013 11:09 am
Full Name: Niels Engelen
Contact:

Re: Organization creation automation

Post by nielsengelen »

Hereby an example script:

Code: Select all

Import-Module "C:\Program Files\Veeam\Backup365\Veeam.Archiver.PowerShell\Veeam.Archiver.PowerShell.psd1"

$applicationname = "VBO365-PS"
$keydescription = "Auto Install PowerShell"
$keyfriendlyname = "Auto Install PowerShell"

$hostname = ([System.Net.Dns]::GetHostEntry([string]$env:computername).hostname)
$cert = New-SelfSignedCertificate -subject $hostname -NotAfter (Get-Date).AddYears(10) -KeyDescription $keydescription -KeyFriendlyName $keyfriendlyname
$certfile = (Join-Path $env:TEMP "cert.pfx")
$certpassword = ConvertTo-SecureString -String “tmpunsecure” -Force –AsPlainText
Export-PfxCertificate -Cert $cert -FilePath $certfile -Password $certpassword

$newAppSettings = New-VBOOffice365ApplicationOnlyConnectionSettings -ApplicationCertificatePath $certfile -ApplicationCertificatePassword $certpassword -NewApplicationName $applicationname

Add-VBOOrganization -Office365ExchangeConnectionsSettings $newAppSettings -Office365SharePointConnectionsSettings $newAppSettings
This will still require you to use devicelogin with the code which will be shown as output.

I would suggest replacing "tmpunsecure" by something random as well :-)
https://foonet.be

Joffrey
Novice
Posts: 3
Liked: never
Joined: Sep 10, 2020 8:19 am
Contact:

Re: Organization creation automation

Post by Joffrey »

OMG ! So many thanks !

Post Reply

Who is online

Users browsing this forum: charwah and 2 guests