Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

AD Group

Hi, we are facing an issue with the AD that we havw 4 group types in that 1 group type is unable to bring into power bi because it is a online group, AD group team said online group type it wont is their any alternate way to bring this group type or all the group types at one time 

  • First, you need to install the AzureAD module if it's not already installed:

     

    powershell

    Install-Module -Name AzureAD

     

     

    Then, you can use this script to fetch all groups (including online groups) from Azure AD:

    # Connect to Azure AD
    Connect-AzureAD

    # Get all groups
    $groups = Get-AzureADGroup

    # Export to CSV
    $groups | Select-Object DisplayName, Description, GroupTypes, MailEnabled, SecurityEnabled | Export-Csv -Path "C:\AD_Groups.csv" -NoTypeInformation

     

    This will give you a CSV file containing details about all groups in Azure AD, including whether they are mail-enabled, security-enabled, and their types.

     

    On-Premises AD Groups:

    For on-premises AD, you can use the ActiveDirectory module. First, install it if necessary:

     

    Install-WindowsFeature -Name "RSAT-AD-PowerShell"

     

    Then, run this script to fetch groups from your on-premises AD:

     

    # Import AD module
    Import-Module ActiveDirectory

    # Get all groups
    $groups = Get-ADGroup -Filter *

    # Export to CSV
    $groups | Select-Object Name, GroupCategory, GroupScope, Description | Export-Csv -Path "C:\AD_OnPrem_Groups.csv" -NoTypeInformation

     

    Combining Online and On-Prem Groups:

    Once you have both CSV files (one from Azure AD and one from on-prem AD), you can combine them in Power BI.

    Would you like more details on how to automate the import or merge of these datasets in Power BI?

3 Replies

  • 123abc's avatar
    123abc
    Community Champion

    First, you need to install the AzureAD module if it's not already installed:

     

    powershell

    Install-Module -Name AzureAD

     

     

    Then, you can use this script to fetch all groups (including online groups) from Azure AD:

    # Connect to Azure AD
    Connect-AzureAD

    # Get all groups
    $groups = Get-AzureADGroup

    # Export to CSV
    $groups | Select-Object DisplayName, Description, GroupTypes, MailEnabled, SecurityEnabled | Export-Csv -Path "C:\AD_Groups.csv" -NoTypeInformation

     

    This will give you a CSV file containing details about all groups in Azure AD, including whether they are mail-enabled, security-enabled, and their types.

     

    On-Premises AD Groups:

    For on-premises AD, you can use the ActiveDirectory module. First, install it if necessary:

     

    Install-WindowsFeature -Name "RSAT-AD-PowerShell"

     

    Then, run this script to fetch groups from your on-premises AD:

     

    # Import AD module
    Import-Module ActiveDirectory

    # Get all groups
    $groups = Get-ADGroup -Filter *

    # Export to CSV
    $groups | Select-Object Name, GroupCategory, GroupScope, Description | Export-Csv -Path "C:\AD_OnPrem_Groups.csv" -NoTypeInformation

     

    Combining Online and On-Prem Groups:

    Once you have both CSV files (one from Azure AD and one from on-prem AD), you can combine them in Power BI.

    Would you like more details on how to automate the import or merge of these datasets in Power BI?

  • 123abc's avatar
    123abc
    Community Champion

    If the online group type from Active Directory (AD) is not being directly imported into Power BI, there are a few potential alternatives you can explore:

    1. Azure AD Data Connector: If you're using Azure Active Directory (AAD), Power BI offers connectors to access AAD data. You could try connecting Power BI to Azure AD using the "Azure Active Directory" connector to bring in group information, including online groups.

    2. Custom API or Graph API: You can access all groups, including online groups, using the Microsoft Graph API. By setting up a custom data source using the Graph API, you can extract information about all groups (on-premise and online). This would involve writing a query to pull the specific group data and then bringing it into Power BI.

    3. Manual Export: If the online groups can be exported from AD or a related system (e.g., from Azure AD) into a CSV or Excel file, you can import this data into Power BI.

    4. Custom Script: Using PowerShell, you can script a solution to pull both on-premises and online AD group types and then load them into Power BI. You could export the data as a CSV or use a connector.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks you i will try it, do we have any powershell script available already