My Pentesting Space
LinkedIn
  • Welcome to Hackjiji
  • 🕸️web pentesting
    • Basics
    • Web pentest cheatsheet
    • Burpsuite and browser tricks
    • cUrl cheatsheet
    • CVE exploitation
    • JavaScript Obfuscation/Deobfuscation
  • Network pentesting
    • Basics
    • Nmap favorites
    • Host discovery
    • Port scanning
    • Network Services
      • RPC-NFC
      • WINRM - 5895-5896
      • FTP - 21
      • SMB - 445
      • RDP - 3389
      • SSH - 22
      • SMTP - 25
    • Firewall evasion
    • Pivoting and double pivoting
  • Physical pentesting
    • Bad USB - Rubber Duckies
  • Linux pentesting
    • Usefull command's
    • Privilege escalation
  • windows pentesting
    • Windows useful commands
    • Windows Reverse shell codes
    • Privilege escalation
  • Active Directory pentesting
    • Basics
    • AD
    • AAD
  • General
    • Hash cracking
    • Wordlist
    • Encoding/decoding
    • Environment setup
      • Install a new OS on seperated boot sector
      • Hyper-V
      • Virtualbox
    • Reverse-shell-cheatsheet
    • Metasploit cheatsheet
    • Vulnerability research
    • My scanning methodology
  • Events
    • HackTheBox Meetup - LFI2RCE
    • Radio Equans - QR Code Awareness campaign
    • Cybersecurity job campaign
Powered by GitBook
On this page
  • AAD Enumeration with powershell
  • Other Azure AD command's
  1. Active Directory pentesting

AAD

AAD Enumeration with powershell

install-module AzureAD
Connect-AzureAD
Get-AzureADUser -All $true
Get-AzureADUser 
Get-AzureADUser -All $true | Where-Object { $_.UserType -eq 'Member' } | Select-Object UserPrincipalName

Get-AzureADUser cmdlet with filtering and the Select-Object cmdlet to get the top 100 non-guest accounts. Here’s how:

Get-AzureADUser -All $true | Where-Object { $_.UserType -eq 'Member' } | Select-Object -First 100

Connect-AzureAD: Connects to Azure Active Directory

Connect-AzureAD

Get-AzureADUser: Retrieves user information

Get-AzureADUser -All $true

Get-AzureADGroup: Lists all groups in Azure AD

Get-AzureADGroup

Get-AzureADGroupMember: Lists members of a specific group

Get-AzureADGroupMember -ObjectId "GROUP_ID"

Get-AzureADDirectoryRole: Retrieves directory roles

Get-AzureADDirectoryRole

Get-AzureADDirectoryRoleMember: Lists members of a directory role

Get-AzureADDirectoryRoleMember -ObjectId "ROLE_ID"

Get-AzureADPolicy: Retrieves Azure AD policies

Get-AzureADPolicy

Get-AzureADServicePrincipal: Lists service principals

Get-AzureADServicePrincipal

Get-AzureADUserLicenseDetail: Retrieves license details for a user

Get-AzureADUserLicenseDetail -ObjectId "USER_ID"

Get-AzureADUserMembership: Lists group memberships for a user

Get-AzureADUserMembership -ObjectId "USER_ID"

Other Azure AD command's

Name

Description

Can help you to retrieve the details of the lists of devices from your Azure AD.

Helps you to create a brand new device in your Azure Active Directory.

Updates the details of your Azure AD device.

Remove an Azure AD device.

Retrieve the details of your Azure AD Policy.

Create a brand new Azure AD Policy using this PowerShell command.

Update your Azure AD Policy.

Delete any unwanted Azure AD policy using this PowerShell command.

Retrieve the details of a directory role from your Azure Active Directory using this command.

Update the entities in the Azure Active Directory users.

This command will retrieve the details of a directory role from your Azure Active Directory.

Helps you to disconnect your current session from your Azure Active Directory tenant.

Helps you to use Azure AD cmdlet requests by connecting with an authenticated account.

Use this command to get the specified user membership in the Azure AD.

Helps you to get user details from your Azure Active Directory.

Can get you the list of AD users.

Use this command to remove the entity from the Azure AD groups.

Helps get the objects’ details based on the specified Object IDs.

Use the New-AzADApplication PowerShell cmdlet to add the new entity to your applications.

Use this command to get the lists of Azure Active Directory Groups.

It will get you the security settings in the Azure Security Center.

Get the list of entities from the applications.

It helps you quickly create a predefined Azure tag.

Can help you to retrieve the lists of predefined Azure tags from your subscription.

Use this command to add a route to a specified Azure route table.

This can help you to retrieve the route tables under a Resource Group.

Helps you to retrieve the lists of Azure storage containers.

Helps you to remove the storage container that you have specified with this command.

Get the lists of storage queues associated with the specified storage account.

Use this command to get the entities from the service principals.

It helps you to add a credential to an existing service principal.

Update the configs of your Azure PowerShell using this command.

Helps you to uninstall or remove all the AzureRm modules from your machine

Helps you to create an Azure Storage context quickly.

Can help you to save the Az context of your current Azure session into a specified location or path.

Retrieve the endpoints and the metadata for the instance of the Azure services.

Use this command to add edit or set the default to your current Azure Context.

Retrieve the policy assignments.

Helps to clear the current context default values set by the user.

Helps you to retrieve the feature details like Feature name, Registration State, Provider name, etc. in a second.

Clear all the configuration values set by the user using this command.

Create a management group in seconds using this command.

Removes the specified Azure resource.

Helps you to assign an RBAC role to a specific principal for a specified scope.

Removes a lock from an Azure resource.

Modify your Azure resource group in seconds.

Save your resource group as a template with a JSON file format.

Retrieve the list of Azure RBAC roles that are available that you can assign.

Quickly create an Azure resource like a website or an Azure SQL database/server in a resource group.

Quickly get the Azure resource provider.

Retrieve the Azure resource locks.

Get a list of all the Azure resources.

Retrieve the lists of all the configs of your Azure PowerShell.

Retrieve the metadata details.

Add the Azure account to the Windows PowerShell.

It helps you set the subscription, tenant, and environments for different PowerShell commands for your current PowerShell session.

It helps you help you connect to Azure with one particular authenticated account.

Disconnect an Azure account that you are connected to currently.

Delete/clear all the Azure credentials, subscription and account details, etc.

Retrieve the location details and their supported resource providers.

Retrieve the deployment details under the current subscription.

Helps to force Sync Azure AD Connect or to run a sync cycle manually.

Get the details of the Azure AD groups via the MS Graph.

Modify different properties of the Azure AD group.

Retrieve the list of service principals from your Azure Active Directory.

Get the soft deleted AD object from the Azure Active Directory.

Retrieve the List of Azure Subscriptions.

Get the subscription details that the current account can access.

Helps to connect to the authenticated account for using the Azure RM cmdlets.

Can get you the lists of all the role assignments under your subscription or a specific scope.

Can help you to invite an external user to your Azure Active directory.

Can help you to initiate a connection to your Azure Active Directory.

Can help you to retrieve the metric values of an Azure resource.

Help you to set and clear your current and default Azure subscriptions.

Help you retrieve the Azure SQL database lists from your Azure SQL Database Server.

Can help you to create a storage table quickly.

Use this Azure PowerShell command to modify or update your Azure Storage account.

Can help you to get the lists of available storage tables associated with the specified Storage account.

Help you retrieve the Activity Log event lists from your Azure Subscription.

Can help you to create a new Azure AD group.

Can help you to create a new Azure AD user.

Helps you to add members to an Azure AD group.

Help you to list the members from an Azure AD group.

It helps to start your Azure VM.

It helps you to retrieve information about your Azure Web App.

It can help you modify your Azure Web App.

It helps you to return the Application Insights components.

It helps to retrieve an Azure App Service plan in the resource group that you have specified.

It helps you quickly find the AD users in your domain.

It helps you helps to retrieve the lists of virtual networks under a resource group.

It helps you to retrieve the details of a subnet inside a Virtual network.

It helps you retrieve the details of a subnet inside a virtual network.

It can help you quickly create an App service plan for a specific region.

It helps you to retrieve the properties of a Managed disk.

Name

Description

Learn how the Select-AZSubscription command can be used to change the Azure subscription.

Check out how to get tenant id in Azure using PowerShell.

Learn how to list Resource Groups using the PowerShell command Get-AzResourceGroup.

PreviousADNextHash cracking

Last updated 5 months ago

Get-AzureADDevice
New-AzureADDevice
Set-AzureADDevice
Remove-AzureADDevice
Get-AzureADPolicy
New-AzureADPolicy
Set-AzureADPolicy
Remove-AzureADPolicy
Get-AzureADDirectoryRole
Update-AzADUser
Get-AzureADObjectByObjectId
Disconnect-AzureAD
Connect-AzureAD
Get-AzureADUserMembership
Get-AzureADUser
Get-AzADUser
Remove-AzADGroup
Get-AzADApplication
New-AzADApplication
Get-AzADGroup
Get-AzSecuritySetting
Get-AzTenant
New-AzTag
Get-AzTag
Add-AzRouteConfig
Get-AzRouteTable
Get-AzStorageContainer
Remove-AzStorageContainer
New-AzStorageContext
Get-AzADServicePrincipal
New-AzADSpCredential
Update-AzConfig
Uninstall-AzureRm
Set-AzDefault
Save-AzContext
Get-AzEnvironment
Get-AzProvi
derFeature
Get-AzPolicyAssignment
Clear-AzDefault
Clear-AzConfig
New-AzManagementGroup
Set-AzResourceGroup
Remove-AzResource
New-AzRoleAssignment
Remove-AzResourceLock
New-AzResource
Export-AzResourceGroup
Get-AzRoleDefinition
Get-AzRoleAssignment
Get-AzResourceProvider
Get-AzResourceLock
Get-AzResource
Get-AzConfig
Get-AzContext
Add-AzureAccount
Set-AzContext
connect-AzAccount
Disconnect-AzAccount
Clear-AzContext
Get-AzLocation
Get-AzDeployment
Start-ADSyncSyncCycle
Get-AzureADMSGroup
S
et-AzureAD
MSGroup
Get-AzureADServicePrincipal
Get-AzureADMSDeletedDirectoryObject
Get-AzSubscription
Get-azurermsubscription
Connect-AzureRMAccount
Select-AzureSubscription
New-AzureADMSInvitation
Connect-msolservice
Get-AzMetric
Get-AzSqlDatabase
Get-AzSqlServer
Get-AzStorageTable
Set-AzStorageAccount
Get-AzActivityLog
Get-AzADGroupMember
New-AzADGroup
New-AzADUser
Add-AzADGroupMember
Get-AzADAppCredential
Start-AzVM
Get-AzWebApp
Set-AzWebApp
Get-AzApplicati
o
nInsights
Get-AzAppServicePlan
Get-Aduser
Get-AzVirtualNetwork
Get-AzVirtualNetworkSubnetConfig
New-AzAppServicePlan
Get-AzKeyVaultSecret
Get-AzDisk
Azure Powershell change subscription
How to get tenant id in Azure using PowerShell
Azure PowerShell List Resource Groups