^.*@example.com$のようなパターンは対応していない
こんなパターンを使うと
^.*@example.com$
こんな感じのエラーが出てしまう。
Error executing cmdlet:
|System.ArgumentException|The specified regular expression '^.\.@example.com$' is invalid.
"You cannot configure a pattern that begins with a wildcard like (., .+, .{0,n} or .{1,n}). You must remove the wildcard from the beginning of the pattern to continue." (Parameter 'RecipientAddressMatchesPatterns')
Exception of type 'Microsoft.Exchange.Management.PSDirectInvoke.DirectInvokeCmdletExecutionException' was thrown.
実は\SならOK
^\S*@example.com$ ^\S*.user@example.com$のような感じで書ける。
\Sは空白以外の単一文字と一致するので、仕様的にはむしろ適切。