Partager via


Resolving a Primary Group ID

Applies To: Windows Server 2008 R2

This topic explains how to use the Active Directory module for Windows PowerShell to resolve a primary group ID. By default, a user’s primary group is Domain Users. The user's primary group applies only to users who log on to the network through Services for Macintosh or who run Portable Operating System Interface (POSIX)–compliant applications. Unless you are using these services, there is no need to change the primary group from Domain Users.

Example

The following example demonstrates how to resolve the primary group ID of the user Sara Davis in the Fabrikam.com domain. Enter each command on a separate line:

Get-ADUser SaraDavis -Properties PrimaryGroup

$DomainSID = (Get-ADDomain ‘DC=Fabrikam,DC=com).DomainSID

$GroupSID=$DomainSID + "-" + $PGID

Get-ADGroup $GroupSID

Additional information

For a full explanation of the parameters that you can pass to Get-ADUser, Get-ADDomain or Get-ADGroup, at the Active Directory module command prompt, type Get-Help Get-ADUser –detailed, Get-Help Get-ADDomain –detailed, or Get-Help Get-ADGroup –detailed, and then press ENTER.