Passing credentials

Passing credentials into a remote session means the second hop can authenticate without being dependent on authentication tokens from the original system.

In this example, the using variable scope is used to access a credential variable. The credential is used to run a query against Active Directory from a remote system:

$Credential = Get-Credential 
Invoke-Command -ComputerName PSTest -ScriptBlock { 
    Get-ADUser -Filter * -Credential $using:Credential 
} 
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.165.246