Get-ADUser CSV file disabled true and false filter

时间:2017-08-30 20:10:35

标签: powershell active-directory

The script below works as is, I need to add the -47.1213 piece so I can audit the user list to see if they are also enabled (not just disabled). I have tried various ways and the scripted error out. Can anyone help?

{ 
    "_id" : {
        "loc" : {
            "type" : "Point", 
            "coordinates" : [
                -47.1213, 
                -18.1515
            ]
        }
    }, 
    "qtd" : 4.0
}

1 个答案:

答案 0 :(得分:0)

要获得.csv中列出的启用和禁用用户,您只需要停止对Enabled -eq $false进行过滤。只需更改此行:

Get-ADUser -Filter {employeeID -eq $employeeID -and Enabled -eq $false} -Properties displayName,employeeID,mail,intelOwnerID,title,"msDS-UserPasswordExpiryTimeComputed","lastLogon" |

 Get-ADUser -Filter {employeeID -eq $employeeID} -Properties displayName,employeeID,mail,intelOwnerID,title,"msDS-UserPasswordExpiryTimeComputed","lastLogon" |