ChamplainTechJournals/sysadmin-i-sys255/lab10-powershell.md
2025-04-19 23:42:08 -04:00

1.2 KiB

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

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
  • Invoke-Command -ComputerName <computername> -ScriptBlock { <command> } - launch a command remotely
  • Enable-PSRemoting - allows remote commands to be executed on this machine