Quantcast
Viewing all articles
Browse latest Browse all 311

PowerShell • does not contain a method named 'op_Addition'

When I type the following code in a PowerShell console window (version 5.1) it works fine:
$locked = @()
$locked = Search-ADAccount -LockedOut

But when I run it in PowerShell Studio 2024 I get:

ERROR: Method invocation failed because [Microsoft.ActiveDirectory.Management.ADAccount] does not contain a method named 'op_Addition'.
Unlock-Backup.ps1 (21, 2): ERROR: At Line: 21 char: 2
ERROR: + $locked = Search-ADAccount -LockedOut
ERROR: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ERROR: + CategoryInfo : InvalidOperation: (op_Addition:String) [], RuntimeException
ERROR: + FullyQualifiedErrorId : MethodNotFound

Any idea what I'm doing wrong?

Statistics: Posted by wartech — Fri Nov 08, 2024 6:34 am — Replies 2 — Views 24



Viewing all articles
Browse latest Browse all 311

Trending Articles