###########################################################################
## Powershell Script for counting no of AD Groups based on GroupCategory ##
###########################################################################
Import-Module activedirectory
$a = (Get-ADGroup -server <xxDomainNamexx> -filter 'GroupCategory -eq "Distribution"').count
Write-Host "There are" $a "total distribution groups in <xxDomainNamexx> Active Directory."
$b = (Get-ADGroup -server <xxDomainNamexx> -filter 'GroupCategory -eq "security"').count
Write-Host "There are" $b "total security groups in <xxDomainNamexx> Active Directory."
## Powershell Script for counting no of AD Groups based on GroupCategory ##
###########################################################################
Import-Module activedirectory
$a = (Get-ADGroup -server <xxDomainNamexx> -filter 'GroupCategory -eq "Distribution"').count
Write-Host "There are" $a "total distribution groups in <xxDomainNamexx> Active Directory."
$b = (Get-ADGroup -server <xxDomainNamexx> -filter 'GroupCategory -eq "security"').count
Write-Host "There are" $b "total security groups in <xxDomainNamexx> Active Directory."
No comments:
Post a Comment