From 73795f6498c3cb035027153468947b4e76df7147 Mon Sep 17 00:00:00 2001 From: Erwin Date: Wed, 4 Jun 2025 14:12:52 +0200 Subject: [PATCH] Update Add-MgServicePrincipalPassword.md added the $servicePrincipalId and showing the output of the command in $secret. Otherwise you don't know what the new secret is. --- .../Add-MgServicePrincipalPassword.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/microsoftgraph/graph-powershell-1.0/Microsoft.Graph.Applications/Add-MgServicePrincipalPassword.md b/microsoftgraph/graph-powershell-1.0/Microsoft.Graph.Applications/Add-MgServicePrincipalPassword.md index 4ed19094e6d..48bd4ab36dd 100644 --- a/microsoftgraph/graph-powershell-1.0/Microsoft.Graph.Applications/Add-MgServicePrincipalPassword.md +++ b/microsoftgraph/graph-powershell-1.0/Microsoft.Graph.Applications/Add-MgServicePrincipalPassword.md @@ -61,13 +61,17 @@ Add a strong password or secret to a servicePrincipal object. Import-Module Microsoft.Graph.Applications +$servicePrincipalId = 'your-service-principal-id' + $params = @{ passwordCredential = @{ displayName = "Password friendly name" } } -Add-MgServicePrincipalPassword -ServicePrincipalId $servicePrincipalId -BodyParameter $params +$secret = Add-MgServicePrincipalPassword -ServicePrincipalId $servicePrincipalId -BodyParameter $params + +$secret | format-list ``` This example shows how to use the Add-MgServicePrincipalPassword Cmdlet.