The property cannot be processed because the property type already exists

%3CLINGO-SUB%20id%3D%22lingo-sub-1976845%22%20slang%3D%22en-US%22%3EThe%20property%20cannot%20be%20processed%20because%20the%20property%20type%20already%20exists%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1976845%22%20slang%3D%22en-US%22%3E%3CP%3EI%20receive%20the%20above%20message%20when%20running%20the%20below%20command.%3C%2FP%3E%3CP%3E%3CSPAN%3EGet-RetentionCompliancePolicy%20-identity%20%22Name%20of%20Policy%22%20-DistributionDetail%20%7C%20Select-Object%20-property%20%40%7Bn%22Policy%20Name%22%3Be%3D%7B%24_.Name%7D%7D%2C%40%7Bn%3DUser%22%3Be%7B%24_.ExchangeLocation%7D%7D%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EI%20do%20see%20the%20results%20I%20want%20after%20the%20errors%20appear.%20Im%20trying%20to%20understand%20why%20the%20errors%20appear%20to%20improve%20my%20knowledge%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1976845%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1976956%22%20slang%3D%22en-US%22%3ERe%3A%20The%20property%20cannot%20be%20processed%20because%20the%20property%20type%20already%20exists%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1976956%22%20slang%3D%22en-US%22%3E%3CP%3EYou%20have%20a%20bunch%20of%20syntax%20errors%2C%20mostly%20missing%20%22%3D%22.%20Try%20this%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3EGet-RetentionCompliancePolicy%20-DistributionDetail%20%7C%20Select-Object%20-property%20%40%7Bn%3D%22Policy%20Name%22%3Be%3D%7B%24_.Name%7D%7D%2C%40%7Bn%3D%22User%22%3Be%3D%7B%24_.ExchangeLocation%7D%7D%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E
New Contributor

I receive the above message when running the below command.

Get-RetentionCompliancePolicy -identity "Name of Policy" -DistributionDetail | Select-Object -property @{n"Policy Name";e={$_.Name}},@{n=User";e{$_.ExchangeLocation}}

 

I do see the results I want after the errors appear. Im trying to understand why the errors appear to improve my knowledge

2 Replies

You have a bunch of syntax errors, mostly missing "=". Try this:

 

Get-RetentionCompliancePolicy -DistributionDetail | Select-Object -property @{n="Policy Name";e={$_.Name}},@{n="User";e={$_.ExchangeLocation}}

@Vasil Michev 

Hey,

Thank you so much for your quick response.

The syntax works, but I was aiming to display the user's email address along with the name of the policy.

Both have the property value of Name

Get-RetentionCompliancePolicy -DistributionDetail | Select -ExpandProperty ExchangeLocation | Select Name