Skip to content

Commit 3863469

Browse files
committed
Updated Get-DistributionGroupMember.md-ADO-8426457
1 parent 3202486 commit 3863469

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

exchange/exchange-ps/exchange/Get-DistributionGroupMember.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ ms.reviewer:
1212
# Get-DistributionGroupMember
1313

1414
## SYNOPSIS
15+
1516
This cmdlet is available in on-premises Exchange and in the cloud-based service. Some parameters and settings may be exclusive to one environment or the other.
1617

1718
Use the Get-DistributionGroupMember cmdlet to view the members of distribution groups and mail-enabled security groups.
@@ -32,20 +33,23 @@ Get-DistributionGroupMember [-Identity] <DistributionGroupMemberIdParameter>
3233
```
3334

3435
## DESCRIPTION
36+
3537
If your organization has multiple Active Directory domains, you may need to run the Set-ADServerSettings cmdlet with the ViewEntireForest parameter set to $true before running the Get-DistributionGroupMember cmdlet to view the entire forest. For more information, see Example 2.
3638

3739
You need to be assigned permissions before you can run this cmdlet. Although this topic lists all parameters for the cmdlet, you may not have access to some parameters if they're not included in the permissions assigned to you. To find the permissions required to run any cmdlet or parameter in your organization, see [Find the permissions required to run any Exchange cmdlet](https://learn.microsoft.com/powershell/exchange/find-exchange-cmdlet-permissions).
3840

3941
## EXAMPLES
4042

4143
### Example 1
44+
4245
```powershell
4346
Get-DistributionGroupMember -Identity "Marketing USA"
4447
```
4548

4649
This example returns the existing distribution group members for the distribution group named Marketing USA.
4750

4851
### Example 2
52+
4953
```powershell
5054
Set-ADServerSettings -ViewEntireForest $true
5155
@@ -57,6 +61,7 @@ This example sets the scope of the search to the entire forest by running the Se
5761
## PARAMETERS
5862

5963
### -Identity
64+
6065
The Identity parameter specifies the distribution group or mail-enabled security group. You can use any value that uniquely identifies the group. For example:
6166

6267
- Name
@@ -80,6 +85,7 @@ Accept wildcard characters: False
8085
```
8186
8287
### -Credential
88+
8389
The Credential parameter specifies the username and password that's used to run this command. Typically, you use this parameter in scripts or when you need to provide different credentials that have the required permissions.
8490
8591
A value for this parameter requires the Get-Credential cmdlet. To pause this command and receive a prompt for credentials, use the value `(Get-Credential)`. Or, before you run this command, store the credentials in a variable (for example, `$cred = Get-Credential`) and then use the variable name (`$cred`) for this parameter. For more information, see [Get-Credential](https://learn.microsoft.com/powershell/module/microsoft.powershell.security/get-credential).
@@ -98,6 +104,7 @@ Accept wildcard characters: False
98104
```
99105

100106
### -DomainController
107+
101108
This parameter is available only in on-premises Exchange.
102109

103110
The DomainController parameter specifies the domain controller that's used by this cmdlet to read data from or write data to Active Directory. You identify the domain controller by its fully qualified domain name (FQDN). For example, dc01.contoso.com.
@@ -116,6 +123,7 @@ Accept wildcard characters: False
116123
```
117124

118125
### -IgnoreDefaultScope
126+
119127
This parameter is available only in on-premises Exchange.
120128

121129
The IgnoreDefaultScope switch tells the command to ignore the default recipient scope setting for the Exchange PowerShell session, and to use the entire forest as the scope. You don't need to specify a value with this switch.
@@ -139,6 +147,7 @@ Accept wildcard characters: False
139147
```
140148

141149
### -IncludeSoftDeletedObjects
150+
142151
This parameter is available only in the cloud-based service.
143152

144153
The IncludeSoftDeletedGroups switch specifies whether to include soft-deleted group members in the results. You don't need to specify a value with this switch.
@@ -159,6 +168,7 @@ Accept wildcard characters: False
159168
```
160169

161170
### -ReadFromDomainController
171+
162172
This parameter is available only in on-premises Exchange.
163173

164174
The ReadFromDomainController switch specifies that information should be read from a domain controller in the user's domain. You don't need to specify a value with this switch.
@@ -181,6 +191,7 @@ Accept wildcard characters: False
181191
```
182192

183193
### -ResultSize
194+
184195
The ResultSize parameter specifies the maximum number of results to return. If you want to return all requests that match the query, use unlimited for the value of this parameter. The default value is 1000.
185196

186197
```yaml
@@ -197,18 +208,35 @@ Accept wildcard characters: False
197208
```
198209

199210
### CommonParameters
211+
200212
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/p/?LinkID=113216).
201213

202214
## INPUTS
203215

204216
### Input types
217+
205218
To see the input types that this cmdlet accepts, see [Cmdlet Input and Output Types](https://go.microsoft.com/fwlink/p/?LinkId=616387). If the Input Type field for a cmdlet is blank, the cmdlet doesn't accept input data.
206219

207220
## OUTPUTS
208221

209222
### Output types
223+
210224
To see the return types, which are also known as output types, that this cmdlet accepts, see [Cmdlet Input and Output Types](https://go.microsoft.com/fwlink/p/?LinkId=616387). If the Output Type field is blank, the cmdlet doesn't return data.
211225

212-
## NOTES
213226

214-
## RELATED LINKS
227+
To download a comma-separated values (CSV) file containing all groups and members, use the following cmdlet:
228+
229+
230+
```powershell
231+
$Groups = Get-UnifiedGroup -ResultSize Unlimited
232+
$Groups | ForEach-Object {
233+
$group = $_
234+
Get-UnifiedGroupLinks -Identity $group.Name -LinkType Members -ResultSize Unlimited | ForEach-Object {
235+
New-Object -TypeName PSObject -Property @{
236+
Group = $group.DisplayName
237+
Member = $_.Name
238+
EmailAddress = $_.PrimarySMTPAddress
239+
RecipientType= $_.RecipientType
240+
}}} | Export-CSV "$env:USERPROFILE\Desktop\Office365GroupMembers.csv" -NoTypeInformation -Encoding UTF8
241+
```
242+

0 commit comments

Comments
 (0)