Difference between revisions of "Powershell"

From Stadm
Jump to navigationJump to search
 
Line 37: Line 37:
 
  \t Performs the operation on all specified files in the current directory and its subdirectories.
 
  \t Performs the operation on all specified files in the current directory and its subdirectories.
 
  \c Continues the operation despite any file errors. Error messages will still be displayed.
 
  \c Continues the operation despite any file errors. Error messages will still be displayed.
  \q
+
  \q Suppresses success messages.
 
  \l Performs the operation on a symbolic link versus its destination.
 
  \l Performs the operation on a symbolic link versus its destination.
  
 
=References=
 
=References=

Latest revision as of 14:54, 9 June 2015


Purpose

  • General powershell commands, basic syntax and a few useful links and scripts

Powershell Commands

General Commands

Get-ChildItem
Get-wmiObject
Enter-PSSession
New-PSSession

Group Policy

Powershell Scripts

Legacy(CMD)

  • Still some useful commands we need to know(they can be run in powershell)
gpupdate
gpresult 
w32tm
netsh
icacls

ACLs

  • We can take ownership, add and remove permissions all with the icacls command
  • Take ownership
icacls FILE_NAME /setowner USERNAME /t /c /q
  • grant full permission to one user
icacls FILE_NAME /grant eddie:f /t /q
\t Performs the operation on all specified files in the current directory and its subdirectories.
\c Continues the operation despite any file errors. Error messages will still be displayed.
\q Suppresses success messages.
\l Performs the operation on a symbolic link versus its destination.

References