Skip to content

Commit

Permalink
Fix DirectoryRole error
Browse files Browse the repository at this point in the history
  • Loading branch information
prashant3535 committed Jan 8, 2025
1 parent 88d8bad commit 0364564
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions AzureADRecon.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1925,6 +1925,8 @@ $Header = @"
th {
color:white;
background-color:blue;
position: sticky;
top: 0px;
}
td, th {
border:0px solid black;
Expand Down Expand Up @@ -2859,8 +2861,11 @@ Function Export-ADRExcel
$returndir = Get-Location
Set-Location C:\Windows\assembly\
$refFolder = (Get-ChildItem -Recurse Microsoft.Office.Interop.Excel.dll).Directory
Set-Location $refFolder
Add-Type -AssemblyName "Microsoft.Office.Interop.Excel"
If ($refFolder)
{
Set-Location $refFolder
Add-Type -AssemblyName "Microsoft.Office.Interop.Excel"
}
Set-Location $returndir
Remove-Variable returndir
Remove-Variable refFolder
Expand Down Expand Up @@ -3699,7 +3704,7 @@ Function Get-AADRDirectoryRole

If ($Method -eq 'MSGraph')
{
$AADRDirectoryRoles = @( Get-MgDirectoryRole -All -PageSize $Pagesize)
$AADRDirectoryRoles = @( Get-MgDirectoryRole -All)
If ($AADRDirectoryRoles)
{
Write-Verbose "[*] Total DirectoryRoles: $($AADRDirectoryRoles.Count)"
Expand Down Expand Up @@ -3783,7 +3788,7 @@ Function Get-AADRDirectoryRoleMember

If ($Method -eq 'MSGraph')
{
$AADRDirectoryRoles = @( Get-MgDirectoryRole -All -PageSize $Pagesize)
$AADRDirectoryRoles = @( Get-MgDirectoryRole -All)
If ($AADRDirectoryRoles)
{
$ProcessedDirectoryRoleCount = 0
Expand Down

0 comments on commit 0364564

Please sign in to comment.