Forum Discussion
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" -NoTypeInformationThis 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" -NoTypeInformationCombining 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
- 123abcCommunity 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" -NoTypeInformationThis 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" -NoTypeInformationCombining 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?
- 123abcCommunity 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:
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.
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.
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.
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.
- AnonymousNot applicable
Thanks you i will try it, do we have any powershell script available already