I'm trying to get AD users list with 'certificates' property. But when i'm doing
$users = Get-ADUser -searchbase "CN=Users,DC=mydomain,DC=com" -filter * -Properties “Certificates”
I'm getting strange error
Get-ADUser : Cannot find the requested object.
At line:1 char:10
+ $users = Get-ADUser -searchbase "CN=Users,DC=mydomain,DC=com" -filte ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-ADUser], CryptographicException
+ FullyQualifiedErrorId : ActiveDirectoryCmdlet:System.Security.Cryptography.CryptographicException,Microsoft.Ac
tiveDirectory.Management.Commands.GetADUser
When I'm doing this without variable
Get-ADUser -searchbase "CN=Users,DC=mydomain,DC=com" -filter * -Properties “Certificates”
I'm getting the list of users and certificates and the error above in the end of the list. But how can I pass data to variable? Tryed with erroraction, still no result.