1.Retrieve a user from AD based on Logon Name

Get-ADUser -Identity [LogonName]

2.To retrieve all properties of AD object

Get-ADUser -Identity [LogonName] -Properties *

3.To retrieve a subset of properties and output in table format

Get-ADUser -Identity [LogonName] -Properties *   | Select-Object samaccountname,name..[Any Property] | Format-Table -Autosize

  1. To retrieve a AD group and its properties, members

  Get-ADGroup -Identity [GroupName] -Properperties * | Select -ExpandProperty Members

  1. To retrieve pwd for IIS App Pool account

Import-Module WebAdministration

  Get-ChildItem -Path IIS:\AppPools\ |

Select-Object name, state, managedRuntimeVersion, managedPipelineMode, @{e={$_.processModel.username};l=”username”}, @{e={$_.processModel.password};l=”password”}, @{e={$_.processModel.identityType};l=”identityType”} |

format-table -AutoSize