Hi,
I create users via a ps command like this
New-MsolUser -UserPrincipalName $user.Email -Password $user.Password [...] -PreferredLanguage fr-FR
Knowing that the tenant is in German (de-DE) all the web apps are in german (See image)
So i need to connect to the sharepoint site to be able to add french like this
But I need to do it with powershell because I make a lot of accounts daily with the script.
So I followed a "how to do" where it is given the ps commands like this:
Install-Module -Name Microsoft.Online.SharePoint.PowerShell -SkipPublisherCheck -Force
$user = "Testuser@my_tenant.onmicrosoft.com"
$password = ConvertTo-SecureString 'a_secret_password_here' -AsPlainText -Force
$creds = New-Object System.Management.Automation.PSCredential ($user,$password)
Connect-PnPOnline -Url "https://tenant-my.sharepoint.com/personal/Testuser_tenant_onmicrosoft_com/_layouts/15/muisetng.aspx" -Credentials $creds
$Web = Get-PnPWeb
$Web.AddSupportedUILanguage(1036) (French)
$web.Update()
Invoke-PnPQuery
but the problem is that this only works if the user has logged in once manually on the sharepoint site, where all of a sudden it kind of creates the user sharepoint url "
"https://my_tenant-my.sharepoint.com/personal/Testuser_my_tenant_onmicrosoft_com/_layouts/15/muisetng.aspx"
It thicks the FR button like here
Otherwise i get the 404 not found error like this
2: /api/attachments/232444-de-fr.png?platform=QnA