Important Notice: On February 29th, this community was put into read-only mode. All existing posts will remain but customers are unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

Find computers with Disabled or delted users.

I would like to find a way to grab current user from PDQ and using a script or something look in Active directory for that user. I'm trying to find computers that the last user to login is not in AD anymore or is disabled.  

 

Thanks

 

 

0

Comments

1 comment
Date Votes
  • To retrieve the Current User for all computers, you can use my module PdqStuff (version 4.1.0 or later).

    Install-Module -Name 'PdqStuff'
    Import-Module -Name 'PdqStuff'
    Get-PdqInventoryComputerData -Table 'Computers' -Columns 'CurrentUser'

    There are a few other columns you can use as well:

    • ADDisplayName = Current User Display Name
    • ADFirstName = Current User First Name
    • ADLastName = Current User Last Name

    I don't have access to an environment with AD right now, so I'm not going to be able to help much with that part. I recommend looking into the AD module that comes with RSAT.

    0