Create Service Principal

Create and output a new Service Principal with password

$sp = NewAzADServicePrincipal -DisplayName "{sp-name}" -Role "{role}"
$sp
$credentials = New-Object pscredential -ArgumentList "temp", $sp.Secret
$credentials.GetNetworkCredential().password

Comments