获取最近24小时内创建的Azure / Msol用户。还是今天

时间:2019-03-25 06:40:53

标签: powershell

我试图在过去24小时或今天从Azure或Msol创建用户。但是我尝试的一切都不起作用;

$When = ((Get-Date).AddDays(-1))
Get-AzureADUser -Filter {(whenCreated -ge $When)} -Properties whenCreated

但这给了我这个错误;

Get-AzureADUser : Cannot evaluate parameter 'Filter' because its argument is specified as a script block and there is 
no input. A script block cannot be evaluated without input.
At line:6 char:25
+ Get-AzureADUser -Filter {(whenCreated -ge $When)} -Properties whenCre ...
+                         ~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : MetadataError: (:) [Get-AzureADUser], ParameterBindingException
    + FullyQualifiedErrorId : ScriptBlockArgumentNoInput,Microsoft.Open.AzureAD16.PowerShell.GetUser

0 个答案:

没有答案