Get Members of AD Group in PowerShell

Get-ADGroupMember command in a Windows PowerShell is used to get the members of an Active Directory (AD) group.

To able to get the AD group members using the ADGroupMember command you need to have an “Active Directory Users and Computers” tool installed and you should be logged into a domain-joined computer as an Active Directory user with the relevant permission.

In this note i will show how to get the AD group members using the ADGroupMember command from the PowerShell.

Cool Tip: How to get Active Directory groups using PowerShell! Read more →

Get Members of AD Group in PowerShell

To get the members of an AD group in the domain the computer is connected to, use the PowerShell’s Get-ADGroupMember command as follows:

PS C:\> Get-ADGroupMember -Identity "<groupName>"

If the AD group which members you need to get is in another domain, add the Server parameter:

PS C:\> Get-ADGroupMember -Identity "<groupName>" -Server <domain>

To get the sorted list of the AD group member names only:

PS C:\> Get-ADGroupMember -Identity "<groupName>" | Select Name | Sort Name

To extract the every member of the “nested” AD group (when another groups are among the group members), add the Recursive attribute:

PS C:\> Get-ADGroupMember -Identity "<groupName>" -Recursive | Select Name | Sort Name

If you are getting an error as follows while trying to execute the commands above, you need to install the Active Directory Users and Computers on your computer:

Get-ADGroupMember : The term ‘Get-ADGroupMember’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Cool Tip: Find out what domain controller am i connected to! Read more →

Get Active Directory Groups – PowerShell

Get-ADGroup command in a Windows PowerShell is used to query a Domain Controller and return Active Directory group objects.

Particularly it can be used to get a list of all the Active Directory groups in the Domain Controller the computer is connected to.

To get the Active Directory groups using the Get-ADGroup command you need to have an “Active Directory Users and Computers” tool installed and you should be logged into a domain-joined computer as an Active Directory user with the relevant permission.

In this note i will show how to get the Active Directory groups using the Get-ADGroup command from the PowerShell.

Cool Tip: Find out what domain controller am i connected to! Read more →

Get Active Directory Groups

To get all the Active Directory groups in the domain the computer is connected to, use the PowerShell’s Get-ADGroup command as follows:

PS C:\> Get-ADGroup -Filter *

To get the Active Directory groups in another domain, add the Server parameter:

PS C:\> Get-ADGroup -Filter * -Server <domain>

To get the sorted list of the Active Directory group names only:

PS C:\> Get-ADGroup -Filter * | Select Name | Sort Name

Use the following construction to search for the Active Directory groups using the PowerShell’s grep equivalent, e.g. to get the Active Directory group names starting with “Adm“):

PS C:\> Get-ADGroup -Filter * | Select Name | Out-String -Stream | Select-String "^Adm.*"

To find a single group, use the Identity parameter, e.g. to check if an Active Directory group called ‘Administrators‘ exists, run the command below:

PS C:\> Get-ADGroup -Identity 'Administrators'

If you are getting an error as follows while trying to execute the commands above, you need to install the Active Directory Users and Computers on your computer:

Get-ADGroup : The term ‘Get-ADGroup’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Cool Tip: How to get the members of an AD group in PowerShell! Read more →

Install “Active Directory Users and Computers”

“Active Directory Users and Computers” is a management console used to administer Active Directory (manage users, groups, computers, polices, etc.).

By default, it is deployed on a Windows Server host, when it’s promoted to the domain controller during the “Active Directory Domain Services” role installation.

But the “Active Directory Users and Computers” can also be installed on a Windows computer manually through a graphical user interface (GUI) or using a Windows PowerShell and this note shows how to do this. (more…)

Open Command Prompt in Folder – CMD & PowerShell

While browsing files and folders in a default Windows graphical file manager application called File Explorer, sometimes you may want to open a folder in a command prompt (CMD) or PowerShell to execute some commands within the current folder.

You can easily open the command prompt or PowerShell directly in the current folder without wasting time on opening them from some other place (e.g. from a “Start” menu) and navigating to the required folder manually.

This note shows very easy and efficient way of how to open the CMD or PowerShell withing the current folder. (more…)

Open File Explorer from CMD & PowerShell

File Explorer, is a default file manager application in Windows that provides a graphical user interface for accessing the file systems.

While working in a Windows command prompt (CMD) or PowerShell, sometimes you may want to open the current folder in the File Explorer to continue working from there.

This note shows how to open the File Explorer from the CMD or Windows PowerShell using the explorer command. (more…)

Increase Image Size in KB (Without Changing Pixels)

Sometimes it is requires to increase an image size without changing its pixels i.e. increase the size of a file without changing a quality, dimension or resolution of the image or photo.

You may need this for example in some applications or web-services that don’t allow to upload images if their size is less than some minimum, e.g. less than 50KB.

There is no need to search for some online “photo size increaser” or install any additional software as Windows, macOS and Linux users can easily increase an image size using the built-in command-line tools.

In this note i will show how to increase an image size without changing its pixels in Windows, macOS and Linux from the command line. (more…)

Split Screen in Windows

In Widows you can split screen by simply dragging a window all the way to one side or corner of the screen until it snaps into place and then select another windows to fill the other parts of your screen.

This way you can split a single monitor into 2, 3 or even 4 screens and work with different windows or applications simultaneously.

If you tend to split windows a lot – the most efficient way is to use keyboard shortcuts.

This note is a cheat-sheet with the split-screen keyboard shortcuts for Windows. (more…)

Zip Without Compression – Windows, Linux, MacOS

If you want to store a big folder as a single file, so it could be easily uploaded somewhere or shared with someone, you can create a simple zip archive from it.

To avoid wasting a time and resources on compression and decompression, this zip archive can be created without compression.

In this short note i will show how to create a zip file without compression from the command line on Windows, Linux and MacOS. (more…)

Linux Rescue USB – Data Recovery & System Repair

Rescue and recovery disks are used for repairing a system and data after a crash on Linux and Windows devices.

They are especially useful for troubleshooting of the boot-related issues and for data recovery.

In this note i will show how to create a bootable rescue USB stick with a SystemRescue (also known as a SystemRescueCD) – a Linux-based rescue toolkit for administrating and repairing of the Windows and Linux-based systems and data recovery. (more…)