migrate to git.charlotte.sh
This commit is contained in:
commit
fbd588721e
412 changed files with 13750 additions and 0 deletions
29
sysadmin-i-sys255/lab10-powershell.md
Normal file
29
sysadmin-i-sys255/lab10-powershell.md
Normal file
|
@ -0,0 +1,29 @@
|
|||
---
|
||||
description: In this lab, we explored basic PowerShell scripting
|
||||
---
|
||||
|
||||
# Lab10 - PowerShell
|
||||
|
||||
## AD Commands
|
||||
|
||||
* `Neq-ADUser -Name "Charlie" -SamAccountName "charlie" - AccountPassword(Read-Host -AsSecureString "Password: ") -Enabled $true`
|
||||
* `Add-ADGroupMember -Identity "Sales-Users" - Members charlie`
|
||||
|
||||
<figure><img src="https://lh7-us.googleusercontent.com/yuCKKzJsbL2VJL5sVPcQIzLyQWuV2TMDL4CLXOJ-Q2nMhLBi6fkPr32FqvM3IN5obMTp2yBmL2xr09AfRQfUF93gZQp5nv9_84wZ0I5QWszJd4xIuA0AwHDKSEw988TywxU2Q1TBqo2UW03g-1l-MA" alt=""><figcaption></figcaption></figure>
|
||||
|
||||
## Allow PS Scripts to be Run
|
||||
|
||||
* `Set-ExecutionPolicy -Scope CurrentUser RemoteSigned`
|
||||
* This allows current users to run local scripts and digitally signed remote scripts
|
||||
|
||||
## Remote Access
|
||||
|
||||
* `Enter-PSSession -ComputerName <computername>` - interactive remote session
|
||||
|
||||
<figure><img src="../assets/79934145188703508417.png" alt=""><figcaption></figcaption></figure>
|
||||
|
||||
* `Invoke-Command -ComputerName <computername> -ScriptBlock { <command> }` - launch a command remotely
|
||||
|
||||
<figure><img src="../assets/86790690807473581275.png" alt=""><figcaption></figcaption></figure>
|
||||
|
||||
* `Enable-PSRemoting` - allows remote commands to be executed on this machine
|
Loading…
Add table
Add a link
Reference in a new issue