Exchange 배포 그룹에 대한 메모 받기

Exchange 배포 그룹에 대한 메모 받기

특정 배포 그룹의 메모를 가져와 배포 그룹의 이름 및 기타 정보와 함께 출력하는 One-Liner를 구축하고 싶습니다. 나는 그것을 검색했고 모두 동일한 솔루션을 가진 다른 소스를 찾았습니다. 제가 찾은 솔루션은 다음과 같습니다.

Get-DistributionGroup Head-of-Operations | Select-Object Name, GroupType, ManagedBy, @{Name="Notes";Expression={(Get-Group $_).Notes}}

이에 대한 소스 중 하나는 다음과 같습니다.

https://richgski.blogspot.com/2012/03/powershell-get-exchange-distribution.html

그러나 메모가 있는 행은 항상 공백으로 유지되며 이유는 모르겠습니다.

Name        GroupType ManagedBy Notes
----        --------- --------- -----
Head-of-Ops Universal {}

다음 명령을 별도로 수행할 때:

Get-Group Head-of-Ops | Select-Object Notes

... 출력으로 올바른 메모를 제공합니다.

Notes
-----
Owner- Paul J.

나는 이제 그것을 조금 더 가지고 놀았습니다. 다음 코드는 완벽하게 작동합니다.

$Result = Get-DistributionGroup Head-of-Operations
Get-Group $Result.Name | Select-Object Notes

산출:

Notes
-----
Owner- Paul J.

하지만 이 기능은 아직 작동하지 않습니다. 오류 없이 실행되지만 Notes는 여전히 비어 있습니다.

Get-DistributionGroup Head-of-Operations | Select-Object Name,GroupType,ManagedBy,@{Name="Notes";Expression={(Get-Group $_.Name | Select-Object Notes)}}

산출:

Name        GroupType ManagedBy Notes
----        --------- --------- -----
Head-of-Ops Universal {}

그 후 여기에서 이 주제에 대한 다른 게시물을 찾았습니다. https://www.oxfordsbsguy.com/2014/04/21/exchange-powershell-how-to-enumerate-distribution-lists-managers-and-members/#comment-4452

그러나 여전히 다음 명령을 사용합니다.

Get-DistributionGroup Head-of-Ops | Select-Object Name,GroupType,ManagedBy,@{Expression={(Get-Group $_.Name).Notes};Label="Notes"}

아무런 메모 없이도 동일한 출력이 표시됩니다...

Name        GroupType ManagedBy Notes
----        --------- --------- -----
Head-of-Ops Universal {}

나는 그것을 이해하지 못한다 :/

여러분 중 누군가가 문제를 보고 나에게 알려줄 수 있습니까?

감사합니다.

케빈 반 티엘

답변1

이제 -verbose 매개변수를 사용하여 이 명령을 실행했으며 이제 솔루션에 한 단계 더 가까워진 것 같습니다. 어느 순간에는 매개변수가 누락된 것 같은데 어떤 매개변수인지는 모르겠습니다. 코드는 다음과 같습니다. (민감한 정보에는 * 별표를 표시했습니다.)

Get-DistributionGroup Head-of-Ops@h***.com -Verbose | Select-Object Name,GroupType,ManagedBy,@{Name="Notes";Expression={(Get-Group $_.Name).Notes}} -Verbose
VERBOSE: [16:04:28.885 GMT] Get-DistributionGroup : Active Directory session settings for 'Get-DistributionGroup' are: View Entire Forest: 'False', Default Scope: 'h***.de', Configuration Domain Controller: 'H***.h***.de',
Preferred Global Catalog: '***.h***.h***.de', Preferred Domain Controllers: '{ ****.h***.h***.de, H***.h***.de }'
VERBOSE: [16:04:28.916 GMT] Get-DistributionGroup : Runspace context: Executing user: h***.de/Companies/H***/D***/User/IT Service/****, Executing user organization: , Current organization: , RBAC-enabled: Enabled.
VERBOSE: [16:04:28.916 GMT] Get-DistributionGroup : Beginning processing &
VERBOSE: [16:04:28.932 GMT] Get-DistributionGroup : Current ScopeSet is: { Recipient Read Scope: {{, }}, Recipient Write Scopes: {{, }}, Configuration Read Scope: {{, }}, Configuration Write Scope(s): {{, }, }, Exclusive Recipient
Scope(s): {}, Exclusive Configuration Scope(s): {} }
VERBOSE: [16:04:28.932 GMT] Get-DistributionGroup : Resolved current organization: .
VERBOSE: [16:04:28.932 GMT] Get-DistributionGroup : Searching objects "Head-of-Ops@h***.com" of type "ADGroup" under the root "$null".
VERBOSE: [16:04:28.932 GMT] Get-DistributionGroup : Previous operation run on domain controller 'H***.h***.de'.
VERBOSE: [16:04:28.932 GMT] Get-DistributionGroup : Previous operation run on domain controller 'H***.h***.de'.
VERBOSE: [16:04:28.932 GMT] Get-DistributionGroup : Preparing to output objects. The maximum size of the result set is "1000".

VERBOSE: [16:04:28.947 GMT] Get-DistributionGroup : Ending processing &
Name        GroupType ManagedBy Notes
----        --------- --------- -----
Head-of-Ops Universal {}

다음 줄은 문제가 묻혀 있다고 생각되는 줄입니다.

VERBOSE: [16:04:28.932 GMT] Get-DistributionGroup : Searching objects "Head-of-Ops@h***.com" of type "ADGroup" under the root "$null".

무엇이 빠졌는지, 왜 그런지 아시는 분 계시나요?

관련 정보