Skip to content

Commit 778263e

Browse files
committed
Fixed docs bugs
1 parent ebe0d76 commit 778263e

31 files changed

+8196
-2980
lines changed

src/Get-MsIdCBACertificateUserIdFromCertificate.ps1

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@
3434
This command retrieves and returns the PrincipalName property.
3535
3636
.OUTPUTS
37-
Returns an object containing the certificateUserIDs that can be used with the givin certificate.
37+
Returns an object containing the certificateUserIDs that can be used with the given certificate.
3838
39+
```
3940
@{
4041
PrincipalName = "X509:<PN>bob@woodgrove.com"
4142
RFC822Name = "X509:<RFC822>user@woodgrove.com"
@@ -45,6 +46,7 @@
4546
SHA1PublicKey = "X509:<SHA1-PUKEY>cD2eF3gH4iJ5kL6mN7oP8qR9sT"
4647
IssuerAndSerialNumber = "X509:<I>DC=com,DC=contoso,CN=CONTOSO-DC-CA<SR>eF3gH4iJ5kL6mN7oP8qR9sT0uV"
4748
}
49+
```
4850
4951
#>
5052

@@ -85,7 +87,7 @@ function Get-MsIdCBACertificateUserIdFromCertificate {
8587
)
8688

8789
$dn = $distinguishedName.Decode([System.Security.Cryptography.X509Certificates.X500DistinguishedNameFlags]::UseNewLines -bor [System.Security.Cryptography.X509Certificates.X500DistinguishedNameFlags]::DoNotUsePlusSign)
88-
90+
8991
$dn = $dn -replace "(\r\n|\n|\r)", ","
9092
return $dn.TrimEnd(',')
9193
}
@@ -157,44 +159,44 @@ function Get-MsIdCBACertificateUserIdFromCertificate {
157159
$certUserIDs = @{
158160
"PrincipalName" = ""
159161
"RFC822Name" = ""
160-
"IssuerAndSubject" = ""
162+
"IssuerAndSubject" = ""
161163
"Subject" = ""
162164
"SKI" = ""
163-
"SHA1PublicKey" = ""
165+
"SHA1PublicKey" = ""
164166
"IssuerAndSerialNumber" = ""
165167
}
166168

167-
if (-not [string]::IsNullOrWhiteSpace($mappingFields.PrincipalName))
169+
if (-not [string]::IsNullOrWhiteSpace($mappingFields.PrincipalName))
168170
{
169171
$certUserIDs.PrincipalName = "X509:<PN>$($mappingFields.PrincipalName)"
170172
}
171173

172-
if (-not [string]::IsNullOrWhiteSpace($mappingFields.EmailName))
174+
if (-not [string]::IsNullOrWhiteSpace($mappingFields.EmailName))
173175
{
174176
$certUserIDs.RFC822Name = "X509:<RFC822>$($mappingFields.EmailName)"
175177
}
176178

177-
if ((-not [string]::IsNullOrWhiteSpace($mappingFields.IssuerName)) -and (-not [string]::IsNullOrWhiteSpace($mappingFields.SubjectName)))
179+
if ((-not [string]::IsNullOrWhiteSpace($mappingFields.IssuerName)) -and (-not [string]::IsNullOrWhiteSpace($mappingFields.SubjectName)))
178180
{
179181
$certUserIDs.IssuerAndSubject = "X509:<I>$($mappingFields.IssuerName)<S>$($mappingFields.SubjectName)"
180182
}
181183

182-
if (-not [string]::IsNullOrWhiteSpace($mappingFields.SubjectName))
184+
if (-not [string]::IsNullOrWhiteSpace($mappingFields.SubjectName))
183185
{
184186
$certUserIDs.Subject = "X509:<S>$($mappingFields.SubjectName)"
185187
}
186188

187-
if (-not [string]::IsNullOrWhiteSpace($mappingFields.SubjectKeyIdentifier))
189+
if (-not [string]::IsNullOrWhiteSpace($mappingFields.SubjectKeyIdentifier))
188190
{
189191
$certUserIDs.SKI = "X509:<SKI>$($mappingFields.SubjectKeyIdentifier)"
190192
}
191193

192-
if (-not [string]::IsNullOrWhiteSpace($mappingFields.Sha1PublicKey))
194+
if (-not [string]::IsNullOrWhiteSpace($mappingFields.Sha1PublicKey))
193195
{
194196
$certUserIDs.SHA1PublicKey = "X509:<SHA1-PUKEY>$($mappingFields.Sha1PublicKey)"
195197
}
196198

197-
if ((-not [string]::IsNullOrWhiteSpace($mappingFields.IssuerName)) -and (-not [string]::IsNullOrWhiteSpace($mappingFields.SerialNumber)))
199+
if ((-not [string]::IsNullOrWhiteSpace($mappingFields.IssuerName)) -and (-not [string]::IsNullOrWhiteSpace($mappingFields.SerialNumber)))
198200
{
199201
$certUserIDs.IssuerAndSerialNumber = "X509:<I>$($mappingFields.IssuerName)<SR>$($mappingFields.SerialNumber)"
200202
}
@@ -211,7 +213,7 @@ function Get-MsIdCBACertificateUserIdFromCertificate {
211213
}
212214

213215
$mappings = Get-CertificateUserIds -cert $cert
214-
216+
215217
if ($CertificateMapping -eq "")
216218
{
217219
return $mappings

src/agentid/Invoke-MsIdAgentIdInteractive.ps1

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
<#
22
.SYNOPSIS
3-
Invokes an interactive creation of Agent ID identities and users
3+
Interactive cmdlet to create and configure an Agent ID.
4+
5+
.DESCRIPTION
6+
Demonstrates the full workflow of creating and configuring an Agent ID Blueprint,
7+
including creating Agent Identities and Agent Users as needed.
8+
9+
Includes prompts for user input at key steps to customize the configuration. Including
10+
options for
11+
12+
* interactive agents
13+
* permissions scopes and
14+
* Agent ID users.
415
#>
516

617
function Invoke-MsIdAgentIdInteractive {
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
---
2+
sidebar_class_name: hidden
3+
description: Adds a client secret to the current Agent Identity Blueprint
4+
id: Add-MsIdClientSecretToAgentIdentityBlueprint
5+
title: Add-MsIdClientSecretToAgentIdentityBlueprint
6+
hide_title: false
7+
hide_table_of_contents: false
8+
custom_edit_url: https://github.com/azuread/msidentitytools/blob/main/src/Add-MsIdClientSecretToAgentIdentityBlueprint.ps1
9+
---
10+
11+
## SYNOPSIS
12+
13+
Adds a client secret to the current Agent Identity Blueprint
14+
15+
## SYNTAX
16+
17+
```powershell
18+
Add-MsIdClientSecretToAgentIdentityBlueprint [[-AgentBlueprintId] <String>]
19+
[-ProgressAction <ActionPreference>] [<CommonParameters>]
20+
```
21+
22+
## DESCRIPTION
23+
24+
Creates an application password for the most recently created Agent Identity Blueprint using New-MgApplicationPassword.
25+
Uses the stored AgentBlueprintId from the last New-AgentIdentityBlueprint call.
26+
27+
## EXAMPLES
28+
29+
### EXAMPLE 1
30+
31+
```powershell
32+
New-MsIdAgentIdentityBlueprint -DisplayName "My Blueprint" -SponsorUserIds @("user1")
33+
Add-MsIdClientSecretToAgentIdentityBlueprint # Uses the stored blueprint ID
34+
```
35+
36+
### EXAMPLE 2
37+
38+
```powershell
39+
Add-MsIdClientSecretToAgentIdentityBlueprint -AgentBlueprintId "12345678-1234-1234-1234-123456789012" # Uses specific ID
40+
```
41+
42+
## PARAMETERS
43+
44+
### -AgentBlueprintId
45+
46+
Optional.
47+
The ID of the Agent Identity Blueprint to add the secret to.
48+
If not provided, uses the stored ID from the last blueprint creation.
49+
50+
```yaml
51+
Type: String
52+
Parameter Sets: (All)
53+
Aliases:
54+
55+
Required: False
56+
Position: 1
57+
Default value: None
58+
Accept pipeline input: False
59+
Accept wildcard characters: False
60+
```
61+
62+
### -ProgressAction
63+
64+
\{\{ Fill ProgressAction Description \}\}
65+
66+
```yaml
67+
Type: ActionPreference
68+
Parameter Sets: (All)
69+
Aliases: proga
70+
71+
Required: False
72+
Position: Named
73+
Default value: None
74+
Accept pipeline input: False
75+
Accept wildcard characters: False
76+
```
77+
78+
### CommonParameters
79+
80+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
81+
82+
## INPUTS
83+
84+
## OUTPUTS
85+
86+
## NOTES
87+
88+
## RELATED LINKS
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
---
2+
sidebar_class_name: hidden
3+
description: Adds inheritable permissions to Agent Identity Blueprints
4+
id: Add-MsIdInheritablePermissionsToAgentIdentityBlueprint
5+
title: Add-MsIdInheritablePermissionsToAgentIdentityBlueprint
6+
hide_title: false
7+
hide_table_of_contents: false
8+
custom_edit_url: https://github.com/azuread/msidentitytools/blob/main/src/Add-MsIdInheritablePermissionsToAgentIdentityBlueprint.ps1
9+
---
10+
11+
## SYNOPSIS
12+
13+
Adds inheritable permissions to Agent Identity Blueprints
14+
15+
## SYNTAX
16+
17+
```powershell
18+
Add-MsIdInheritablePermissionsToAgentIdentityBlueprint [[-Scopes] <String[]>] [[-ResourceAppId] <String>]
19+
[-ProgressAction <ActionPreference>] [<CommonParameters>]
20+
```
21+
22+
## DESCRIPTION
23+
24+
Configures inheritable Microsoft Graph permissions that can be granted to Agent Identity Blueprints.
25+
This allows agents created from the blueprint to inherit specific Microsoft Graph permissions.
26+
27+
## EXAMPLES
28+
29+
### EXAMPLE 1
30+
31+
```powershell
32+
Add-MsIdInheritablePermissionsToAgentIdentityBlueprint # Will prompt for scopes
33+
```
34+
35+
### EXAMPLE 2
36+
37+
```powershell
38+
Add-MsIdInheritablePermissionsToAgentIdentityBlueprint -Scopes @("User.Read", "Mail.Read", "Calendars.Read")
39+
```
40+
41+
### EXAMPLE 3
42+
43+
```powershell
44+
Add-MsIdInheritablePermissionsToAgentIdentityBlueprint -Scopes @("User.Read") -ResourceAppId "00000003-0000-0000-c000-000000000000"
45+
```
46+
47+
## PARAMETERS
48+
49+
### -Scopes
50+
51+
Optional.
52+
Array of Microsoft Graph permission scopes to make inheritable.
53+
If not provided, will prompt for input.
54+
Common scopes include: User.Read, Mail.Read, Calendars.Read, etc.
55+
56+
```yaml
57+
Type: String[]
58+
Parameter Sets: (All)
59+
Aliases:
60+
61+
Required: False
62+
Position: 1
63+
Default value: None
64+
Accept pipeline input: False
65+
Accept wildcard characters: False
66+
```
67+
68+
### -ResourceAppId
69+
70+
Optional.
71+
The resource application ID.
72+
Defaults to Microsoft Graph (00000003-0000-0000-c000-000000000000).
73+
74+
```yaml
75+
Type: String
76+
Parameter Sets: (All)
77+
Aliases:
78+
79+
Required: False
80+
Position: 2
81+
Default value: 00000003-0000-0000-c000-000000000000
82+
Accept pipeline input: False
83+
Accept wildcard characters: False
84+
```
85+
86+
### -ProgressAction
87+
88+
\{\{ Fill ProgressAction Description \}\}
89+
90+
```yaml
91+
Type: ActionPreference
92+
Parameter Sets: (All)
93+
Aliases: proga
94+
95+
Required: False
96+
Position: Named
97+
Default value: None
98+
Accept pipeline input: False
99+
Accept wildcard characters: False
100+
```
101+
102+
### CommonParameters
103+
104+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
105+
106+
## INPUTS
107+
108+
## OUTPUTS
109+
110+
## NOTES
111+
112+
## RELATED LINKS

0 commit comments

Comments
 (0)