Maintain control of your Microsoft 365 data
Post Reply
Joffrey
Novice
Posts: 4
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
Product Manager
Posts: 5635
Liked: 1181 times
Joined: Jul 15, 2013 11:09 am
Full Name: Niels Engelen
Contact:

Re: Organization creation automation

Post by nielsengelen »

Personal blog: https://foonet.be
GitHub: https://github.com/nielsengelen
Joffrey
Novice
Posts: 4
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
Product Manager
Posts: 5635
Liked: 1181 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 :-)
Personal blog: https://foonet.be
GitHub: https://github.com/nielsengelen
Joffrey
Novice
Posts: 4
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: No registered users and 41 guests