Besides the common -Identity parameter, most cmdlets from the Active Directory Module for PowerShell support the -Filter parameter.
If you encounter the following error even though the syntax is correct,
PS C:\> Get-ADGroup -Identity *
Get-ADGroup : Cannot find an object with identity: * under: ‘DC=swissitpro,DC=com’
At line;1 char:1
+ Get-ADGroup -Identity *
+ CategoryInfo : ObjectNotFound: (*:ADGroup) [Get-ADGroup], ADIdentityNotFoundException
simply replace -Identity with -Filter and try again. Obviously this makes sense (and is the only way) to get a list of all defined active directory security and distribution groups in the organisation.