filmov
tv
Using PowerShell - Count of users in a specific OU
![preview_player](https://i.ytimg.com/vi/faOfOKLcHsI/hqdefault.jpg)
Показать описание
Using PowerShell - Count of users in a specific OU
1. Prepare
2. Step by step : Count of users in HR OU, IT OU and QA OU
- DC31 : Count of users in HR OU, IT OU and QA OU
+ Using interface :
+ Using Windows PowerShell
+ Start - Windows PowerShell, type :
+ Get-Aduser -Filter * -SearchBase 'OU=HR,DC=Yi,DC=VN' | Select Name # Display users belong HR OU
+ (Get-Aduser -Filter * -SearchBase 'OU=HR,DC=Yi,DC=VN' | Select Name).Count # Count users belong HR OU
+ Get-Aduser -Filter * -SearchBase 'OU=IT,DC=Yi,DC=VN' | Select Name # Display users belong IT OU
+ (Get-Aduser -Filter * -SearchBase 'OU=IT,DC=Yi,DC=VN' | Select Name).Count # Count users belong IT OU
+ Get-Aduser -Filter * -SearchBase 'OU=QA,DC=Yi,DC=VN' | Select Name # Display users belong QA OU
+ (Get-Aduser -Filter * -SearchBase 'OU=QA,DC=Yi,DC=VN' | Select Name).Count # Count users belong QA OU
1. Prepare
2. Step by step : Count of users in HR OU, IT OU and QA OU
- DC31 : Count of users in HR OU, IT OU and QA OU
+ Using interface :
+ Using Windows PowerShell
+ Start - Windows PowerShell, type :
+ Get-Aduser -Filter * -SearchBase 'OU=HR,DC=Yi,DC=VN' | Select Name # Display users belong HR OU
+ (Get-Aduser -Filter * -SearchBase 'OU=HR,DC=Yi,DC=VN' | Select Name).Count # Count users belong HR OU
+ Get-Aduser -Filter * -SearchBase 'OU=IT,DC=Yi,DC=VN' | Select Name # Display users belong IT OU
+ (Get-Aduser -Filter * -SearchBase 'OU=IT,DC=Yi,DC=VN' | Select Name).Count # Count users belong IT OU
+ Get-Aduser -Filter * -SearchBase 'OU=QA,DC=Yi,DC=VN' | Select Name # Display users belong QA OU
+ (Get-Aduser -Filter * -SearchBase 'OU=QA,DC=Yi,DC=VN' | Select Name).Count # Count users belong QA OU