none
Script to fetch AD users account whose account is going to expire in next 7 days with their Manager's name and ADID RRS feed

  • Question

  • Hi

    Below command works fine but I want to understand the bold and underline part in detail. Can somebody explain me.

    Search-ADAccount -AccountExpiring -UsersOnly -TimeSpan 07.00:00:00 | where {$_.Enabled -eq $true} | Select Name, AccountExpirationdate,Samaccountname ,Enabled, @{Name='ManagerName';Expression={(Get-ADUser (Get-ADUser $_-properties Manager).manager).Name}}, @{Name='ManagerID';Expression={(Get-ADUser (Get-ADUser $_ -properties Manager).manager).sAMAccountName}} | fl Name, Samaccountname, AccountExpirationdate,ManagerName,ManagerID

    Thursday, November 30, 2017 4:29 PM

Answers

  • Run this command at the PowerShell prompt and read about calculated properties:


    PS C:\> help Select-Object -Full
    


    -- Bill Stewart [Bill_Stewart]

    Thursday, November 30, 2017 4:32 PM
    Moderator

All replies

  • Run this command at the PowerShell prompt and read about calculated properties:


    PS C:\> help Select-Object -Full
    


    -- Bill Stewart [Bill_Stewart]

    Thursday, November 30, 2017 4:32 PM
    Moderator
  • Look up "calculated properties" to find blogs explaining what they are and how to use them.


    \_(ツ)_/

    Thursday, November 30, 2017 4:33 PM