You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
838 B
Markdown
43 lines
838 B
Markdown
2 years ago
|
# PS Commands
|
||
|
|
||
|
Note: unless otherwise stated, replace any variable such as `$ComputerName` with the appropriate data.
|
||
|
|
||
|
### Fetch (some) Installed Programs
|
||
|
|
||
|
```powershell
|
||
|
Get-WmiObject win32_product -ComputerName $ComputerName | select Name, version
|
||
|
```
|
||
|
|
||
|
<br>
|
||
|
|
||
|
### Fetch AD Groups with $SearchTerm in them
|
||
|
|
||
|
```powershell
|
||
|
Get-ADGroup -Filter 'name -like "*$SearchTerm*"' | Sort-Object | select Name
|
||
|
```
|
||
|
|
||
|
<br>
|
||
|
|
||
|
### Fetch Boot Time
|
||
|
|
||
|
```powershell
|
||
|
Get-CimInstance -ClassName Win32_OperatingSystem -ComputerName $ComputerName | slect csname, lastbootuptime
|
||
|
```
|
||
|
|
||
|
<br>
|
||
|
|
||
|
### Fetch Computer Group Membership
|
||
|
|
||
|
```powershell
|
||
|
Get-ADPrincipalGroupMembership (Get-ADComputer $ComputerName) | select-object name
|
||
|
```
|
||
|
|
||
|
<br>
|
||
|
|
||
|
### Fetch User Group Membership
|
||
|
|
||
|
```powershell
|
||
|
Get-ADPrincipalGroupMembership (Get-ADUser $Username) | select-object name
|
||
|
```
|
||
|
|
||
|
<br>
|