Skip to content

Commit

Permalink
Added MsId prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
merill committed Jul 12, 2024
1 parent e3f10ba commit ef13d26
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/MSIdentityTools.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
'.\Get-MsIdInactiveSignInUser.ps1'
'.\Set-MsIdServicePrincipalVisibleInMyApps.ps1'
'.\Split-MsIdEntitlementManagementConnectedOrganization.ps1'
'.\Update-InvitedUserSponsorsFromInvitedBy.ps1'
'.\Update-MsIdInvitedUserSponsorsFromInvitedBy.ps1'
)

# Functions to export from this module
Expand Down Expand Up @@ -214,7 +214,7 @@
'Get-MsIdInactiveSignInUser'
'Set-MsIdServicePrincipalVisibleInMyApps'
'Split-MsIdEntitlementManagementConnectedOrganization'
'Update-InvitedUserSponsorsFromInvitedBy'
'Update-MsIdInvitedUserSponsorsFromInvitedBy'
)

# Cmdlets to export from this module
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ ELM - https://learn.microsoft.com/en-us/graph/api/resources/entitlementmanagemen
Invited BY - https://learn.microsoft.com/en-us/graph/api/user-list-invitedby?view=graph-rest-beta
.EXAMPLE
Update-InvitedUserSponsorsFromInvitedBy -All
Update-MsIdInvitedUserSponsorsFromInvitedBy -All
Enumerate all invited users in the Tenant and update Sponsors using InvitedBy value
.EXAMPLE
Update-InvitedUserSponsorsFromInvitedBy -UserId user1@contoso.com,user2@contoso.com
Update-MsIdInvitedUserSponsorsFromInvitedBy -UserId user1@contoso.com,user2@contoso.com
For only specified users in the tenant update Sponsors using InvitedBy value
#>
function Update-InvitedUserSponsorsFromInvitedBy {
function Update-MsIdInvitedUserSponsorsFromInvitedBy {
[CmdletBinding(SupportsShouldProcess,
ConfirmImpact = 'High',
DefaultParameterSetName = 'AllInvitedGuests')]
Expand All @@ -40,11 +40,11 @@ function Update-InvitedUserSponsorsFromInvitedBy {
)

begin {

## Initialize Critical Dependencies
$CriticalError = $null
if (!(Test-MgCommandPrerequisites 'Get-Mguser', 'Update-Mguser' -MinimumVersion 2.8.0 -ErrorVariable CriticalError)) { return }

$guestFilter = "(CreationType eq 'Invitiation')"

}
Expand Down Expand Up @@ -80,8 +80,8 @@ function Update-InvitedUserSponsorsFromInvitedBy {

$invitedBy = Invoke-MgGraphRequest @splatArgumentsGetInvitedBy

Write-Verbose ($invitedBy | ConvertTo-Json)
Write-Verbose ($invitedBy | ConvertTo-Json)

if ($null -ne $invitedBy -and $null -ne $invitedBy.value -and $null -ne (Get-ObjectPropertyValue $invitedBy.value -Property 'id')) {
Write-Verbose ("InvitedBy for Guest User {0}: {1}" -f $InvitedUser.DisplayName, $invitedBy.value.id)

Expand Down Expand Up @@ -114,7 +114,7 @@ function Update-InvitedUserSponsorsFromInvitedBy {

}
else {
Write-Verbose ("------------> Sponsors already contains the user who invited them!")
Write-Verbose ("------------> Sponsors already contains the user who invited them!")
}
}
else {
Expand Down

0 comments on commit ef13d26

Please sign in to comment.