Office365 Userpasswort per Powershell setzen
Mit diesem Script wird das O365 Passwort eines Users gesetzt. Beim ersten Login wird er aufgefordert ein neues Passwort zu vergeben.
$userprincipalname = Read-Host -Prompt EMail
MSOnline\Connect-MsolService #Connect zu O365 Services und Abfrage der Admin-Credentials
IF(Get-MsolUser –UserPrincipalName $userprincipalname -Erroraction SilentlyContinue) #Prüft, ob der Benutzer vorhanden ist
{
Set-MsolUserPassword –UserPrincipalName $userprincipalname –NewPassword Geheim123 -ForceChangePassword $True #Setzt das Passwort auf Geheim123
}
Else
{
'Benutzer ' + $userprincipalname + ' nicht gefunden.'
}
Please also mark the comments that contributed to the solution of the article
Content-Key: 263819
Url: https://administrator.de/contentid/263819
Printed on: April 24, 2024 at 11:04 o'clock
4 Comments
Latest comment