PowerShell


Discover ISO image version

DISM /get-wiminfo /wimfile:"d:\sources\install.wim"

Display phone number values for all accounts

Get-AdUser -Filter * -Properties OfficePhone | FT OfficePhone,UserPrincipalName

Show User accounts with a non-expiring password

Search-ADAccount -PasswordNeverExpires | FT Name, ObjectClass, UserPrincipalName

==================================================================

Reveal if client’s DNS is inherited or assigned locally.

netsh interface ipv4 show dnsservers

==================================================================

Get-ADGroupMember “<Group-Name>” | Select Name, SamAccountName, objectClass > d:\output\output.txt

list and save to text file members of a particular AD group
==================================================================
To view Powershell content in an orderly fashion.

PS> Get-Process -Name powershell | Format-List

To view specific content you want to callout.

PS> Get-Process -Name powershell | Format-List -Property ProcessName,FileVersion
 ,StartTime,Id

ProcessName : powershell
 FileVersion : 1.0.9567.1
 StartTime   : 2006-05-24 13:42:00
 Id          : 2760

ProcessName : powershell
 FileVersion : 1.0.9567.1
 StartTime   : 2006-05-24 13:54:28
 Id          : 3448 only specific entries from process list

===================================================================

Leave a comment