# PS Commands
Note: unless otherwise stated, replace any variable such as `$ComputerName` with the appropriate data.
### Remotely Fetch a (Partial) Installed Program List for $ComputerName
```powershell
Get-WmiObject win32_product -ComputerName $ComputerName | select Name, version
```
### 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
Get-CimInstance -ClassName Win32_OperatingSystem -ComputerName $ComputerName | slect csname, lastbootuptime
```
### Fetch $ComputerName's Group Membership
```powershell
Get-ADPrincipalGroupMembership (Get-ADComputer $ComputerName) | select-object name
```
### Fetch $Username's Group Membership
```powershell
Get-ADPrincipalGroupMembership (Get-ADUser $Username) | select-object name
```