PowerShell
Amazing PowerShell One-Liners for System Administrators
Here is a collection of some really cool PowerShell one-liners scripts. I find them very useful for day to day system administration tasks. I will keep adding to this list as I learn more useful commands. List of all installed applications on a Windows device This one-liner searches the Windows...
How to audit SharePoint using powershell
Sometimes you need to know what information you have got in your SharePoint solution. I have been asked this numerous times since GDPR was introduced. Get-SPWeb http://your-sharepoint-site | Select -ExpandProperty Lists | Where { $_.GetType().Name -eq “SPDocumentLibrary” -and -not $_.Hidden } | Select -ExpandProperty Items | Group {$_.ParentList.ParentWeb.Url + “/”...
Installing Terraform on Windows Desktop and Windows Server
Installing Terraform on Windows Terraform is extremely popular on Linux, but it is now also available on Windows. You need to have PowerShell version 4 or greater installed so it is recommended to install on the following Microsoft Windows products: Windows 10 Desktop Windows Server 2012 Windows Server 2016 It...
Useful WMI Commands
Search WMIObjects Get-WmiObject -Namespace Root\cimv2 -list | where {$_.name -like ‘*disk*’} Awesome WMI explorer tool can be found here – https://powershell.org/2013/03/08/wmi-explorer-from-the-powershell-guy/ WMI contains more properties that Standard Powershell commands eg. Get-Service Get-WmiObject -Class Win32_Service | Select-Object * WMI Win32_operatingsystem last boot uptime conversion $os = gwmi win32_operatingsystem $os.ConvertToDateTime($os.LastBootUpTime) EG -24 October...
VMware PowerCLI OneLiners
Vmware PowerCLI One Liners These commands will save you a mountain of time, despite the formatting of this website they should all copy as single line commands. Find VMs powered off Get-VM | where {$_.powerstate -eq “PoweredOff”} | Sort-Object | get-harddisk | ft parent, capacityGB, Filename -autosize Find Vms CREATED...