diff --git a/ps-commands.md b/ps-commands.md index cbfd1c6..612e1e7 100644 --- a/ps-commands.md +++ b/ps-commands.md @@ -4,10 +4,6 @@ Note: unless otherwise stated, replace any variable such as `$ComputerName` with
-## Computers - -
- ### Remotely Fetch a (Partial) Installed Program List for $ComputerName ```powershell @@ -24,6 +20,14 @@ Get-WmiObject win32_product -ComputerName $ComputerName | Where-Object {$_.$Colu
+### Fetch AD Groups with $SearchTerm in them + +```powershell +Get-ADGroup -Filter 'name -like "*$SearchTerm*"' | Sort-Object | select Name +``` + +
+ ### Remotely Fetch $ComputerName's Boot Time ```powershell @@ -40,40 +44,6 @@ Get-ADPrincipalGroupMembership (Get-ADComputer $ComputerName) | select-object na
-### Remotely Fetch $ComputerName's Make & Model - -```powershell -Get-CimInstance -ComputerName $ComputerName -ClassName Win32_ComputerSystem | Select-Object -Property Manufacturer, Model -``` - -
- -### Remotely Fetch $ComputerName's Serial Number - -```powershell -Get-CimInstance -ComputerName $ComputerName -ClassName Win32_bios | Select-Object -Property SerialNumber -``` - -
- -### Remotely Fetch $ComputerName's Total/Free Storage - -```powershell -Get-WmiObject Win32_LogicalDisk -ComputerName $ComputerName -Filter DriveType=3 | Select-Object DeviceID, @{'Name'='Size (GB)'; 'Expression'={[math]::truncate($_.size / 1GB)}}, @{'Name'='Freespace (GB)'; 'Expression'={[math]::truncate($_.freespace / 1GB)}} -``` - -
- -### Remotely Fetch $ComputerName's BIOS Version - -```powershell -Get-WmiObject -Class Win32_BIOS -ComputerName $ComputerName -``` - -## Users - -
- ### Fetch $Username's Group Membership ```powershell @@ -82,14 +52,16 @@ Get-ADPrincipalGroupMembership (Get-ADUser $Username) | select-object name
-## Groups +### Fetch $ComputerName's Make & Model + +```powershell +Get-CimInstance -ComputerName $ComputerName -ClassName Win32_ComputerSystem | Select-Object -Property Manufacturer, Model +```
-### Fetch AD Groups with $SearchTerm in them +### Fetch $ComputerName's Serial Number ```powershell -Get-ADGroup -Filter 'name -like "*$SearchTerm*"' | Sort-Object | select Name -``` - -
\ No newline at end of file +Get-CimInstance -ComputerName $ComputerName -ClassName Win32_bios | Select-Object -Property SerialNumber +``` \ No newline at end of file