diff --git a/ps-commands.md b/ps-commands.md index 612e1e7..cbfd1c6 100644 --- a/ps-commands.md +++ b/ps-commands.md @@ -4,6 +4,10 @@ Note: unless otherwise stated, replace any variable such as `$ComputerName` with
+## Computers + +
+ ### Remotely Fetch a (Partial) Installed Program List for $ComputerName ```powershell @@ -20,14 +24,6 @@ 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 @@ -44,6 +40,40 @@ 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 @@ -52,16 +82,14 @@ Get-ADPrincipalGroupMembership (Get-ADUser $Username) | select-object name
-### Fetch $ComputerName's Make & Model - -```powershell -Get-CimInstance -ComputerName $ComputerName -ClassName Win32_ComputerSystem | Select-Object -Property Manufacturer, Model -``` +## Groups
-### Fetch $ComputerName's Serial Number +### Fetch AD Groups with $SearchTerm in them ```powershell -Get-CimInstance -ComputerName $ComputerName -ClassName Win32_bios | Select-Object -Property SerialNumber -``` \ No newline at end of file +Get-ADGroup -Filter 'name -like "*$SearchTerm*"' | Sort-Object | select Name +``` + +
\ No newline at end of file