Presentation is loading. Please wait.

Presentation is loading. Please wait.

 An alias is an alternative name assigned to a Cmdlet.  Aliases allow users to quickly interact with the shell.  The Cmdlet get-alias is.

Similar presentations


Presentation on theme: " An alias is an alternative name assigned to a Cmdlet.  Aliases allow users to quickly interact with the shell.  The Cmdlet get-alias is."— Presentation transcript:

1

2

3

4

5

6

7

8  An alias is an alternative name assigned to a Cmdlet.  Aliases allow users to quickly interact with the shell.  The Cmdlet get-alias is used to list all built- in aliases as shown in the diagram on the next slide:

9

10  They are.NET programs used to provide easy access to information external to the shell environment in order for the users to view it and manage it.  To obtain a listing of all the providers, the Get-PSProvider cmdlet is used.  To work with specific providers, use the set- location cmdlet then specify the provider drive.

11  There are seven types of providers namely: 1. Alias - Provides access to the windows PowerShell aliases and their values Get-PSProvider Sl Alias:\ GCI | where-object {$_.name –like “s*”} 2. Environment - Provides access to the Windows environment variables. 3. FileSystem - Provides access to files and directories. 4. Function - Provides access to the functions defined in Windows PowerShell.

12 5. Registry Provides access to the system registry keys and values. 6. Variable Provides access to Windows PowerShell variables and their values. 7. Certificate Provides read-only access to certificate stores and certificates.

13 1.To address recurring problems DirectoryListWithArguments.ps1 foreach ($i in $args) {Get-ChildItem $i | Where-Object {$_.length -gt 1000} | Sort-Object -property name}

14 2.To run the script as a scheduled task ListProcessesSortResults.ps1 $args = "localhost","loopback","127.0.0.1" foreach ($i in $args) {$strFile = "c:\mytest\"+ $i +"Processes.txt" Write-Host "Testing" $i "please wait..."; Get-WmiObject -computername $i -class win32_process | Select-Object name, processID, Priority, ThreadCount, PageFaults, PageFileUsage | Where-Object {!$_.processID -eq 0} | Sort-Object -property name | Format-Table | Out-File $strFile}

15 3. To store and share both the “secret commands” and the ideas behind the scripts AccountsWithNoRequiredPassword.ps1 $args = "localhost" foreach ($i in $args) {Write-Host "Connecting to" $i "please wait..."; Get-WmiObject -computername $i -class win32_UserAccount | Select-Object Name, Disabled, PasswordRequired, SID, SIDType | Where-Object {$_.PasswordRequired -eq 0} | Sort-Object -property name | Write-Host }

16 Scripting support is disabled by default in Windows PowerShell. Running a script when policy is not set generates an error message that must be fixed to allow script execution.

17  There are four levels of execution policy: 1. Restricted Will not run scripts or configuration files 2. AllSigned All scripts and configuration files must be signed by a trusted publisher 3. RemoteSigned All scripts and configuration files downloaded from the internet must be signed by a trusted publisher 4. Unrestricted All scripts and configuration files will run

18  Wilson, E. (2007). Microsoft Windows PowerShell step by step. Washington: Microsoft Press.  Tomsho, G. (2010). MCTS guide to Microsoft Windows Server 2008 Active Directory configuration: Exam 70-640. Boston, MA: Course Technology/Cengage Learning.  Schwichtenberg, H. (2008). Essential PowerShell. The Addison-Wesley Microsoft technology series. Upper Saddle River, NJ: Addison-Wesley.


Download ppt " An alias is an alternative name assigned to a Cmdlet.  Aliases allow users to quickly interact with the shell.  The Cmdlet get-alias is."

Similar presentations


Ads by Google