# Get-AdPermission – The operation couldn’t be performed because object couldn’t be found

During our recent creation of Relay Receive Connector on Exchange 2013 we’ve encountered an error: The operation couldn’t be performed because object. Since time…

blog

25 Feb 2016 de

![Get-AdPermission – The operation couldn’t be performed because object couldn’t be found](/wp-content/uploads/2016/02/PowerShell.png)

During our recent creation of **Relay Receive Connector** on **Exchange 2013** we've encountered an error: **The operation couldn't be performed because object. **Since time was an essence we didn't spent much time debugging the issue and simply found a workaround as shared below. Hopefully will be useful for you.

### ❗ Problem Description

If you run the following command to get permissions assigned to Receive Connector of Exchange an error is displayed

```plain
PS C:\Windows\system32> Get-ReceiveConnector -Identity "MAIL2\SMTP Relay" | Get-ADPermission | ft user
The operation couldn't be performed because object 'MAIL2\SMTP Relay' couldn't be found on 'AD3'.
    + CategoryInfo          : InvalidData: (:) [Get-ADPermission], ManagementObjectNotFoundException
    + FullyQualifiedErrorId : [Server=MAIL1,RequestId=01e7d665-22be-4f01-8519-fb65cc4056b3,TimeStamp=2016-02-25 19:26:59] [FailureC
   ategory=Cmdlet-ManagementObjectNotFoundException] 3A1CC281,Microsoft.Exchange.Management.RecipientTasks.GetADPermission
    + PSComputerName        : mail1
```

Even thou Get-AdPermission shows that the object can't be found, quick verification confirms it's there.

[!\[PowerShell output showing the MAIL2\SMTP Relay receive connector bindings and that it is enabled\](/wp-content/uploads/2016/02/img_56cf54eef1346.png)](/wp-content/uploads/2016/02/img_56cf54eef1346.png)

So what's going on?

### 📧 Solution

It seems the solution to get **Get-AdPermission **running just fine like in example below is very simple.

```plain
Get-ReceiveConnector -Identity "MAIL2\SMTP Relay" | Get-ADPermission | ft user
```

Turns out if you run exactly the same command in **Exchange Management Shell** or standard **PowerShell** Window it works just fine.

```plain
[PS] C:\ExchangeScripts\Manual>Get-ReceiveConnector -Identity "MAIL2\SMTP Relay" | Get-ADPermission | ft user

User
----
NT AUTHORITY\ANONYMOUS LOGON
NT AUTHORITY\ANONYMOUS LOGON
NT AUTHORITY\ANONYMOUS LOGON
NT AUTHORITY\ANONYMOUS LOGON
```

However the reason for this behaviour of **ISE PowerShell is** not known to me at this time. So if you have to work with **Get-AdPermission** commands you may want to run it outside of **ISE**. If we ever find out the reason for this behaviour we will make sure to share the news.

## Zugehörige Projekte

Projekte, die zu Tags, Kategorien und Inhalt dieses Beitrags passen.

[Alle Projekte](/de/projekte/)

Projekte werden abgeglichen...

[Zurück zum Blog](/blog)

## Ähnliche Beiträge

- [Creating Visual Indicators for spoofed / external emails with PowerShell](/de/blog/creating-visual-indicators-for-spoofed-external-emails-with-powershell/)
- [Microsoft Exchange – OU picker is empty when creating new user](/de/blog/microsoft-exchange-ou-picker-empty-creating-new-user/)
- [Exchange 2013 – Health Mailbox has been corrupted](/de/blog/exchange-2013-health-mailbox-has-been-corrupted/)

<!-- PowerForge markdown artifact sha256:7B05ADDF0ED290D2CD3A925F0F2690F9E7D1EF735C9D5227F73AEE5515CB6DE9 -->
