Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#4. Use Invoke-Command to code a One-to-Many Remote Connection to remote computer (Using Variables)

#4. Use Invoke-Command to code a One-to-Many Remote Connection to remote computer (Using Variables) <# -Code a variable named "$Computers" and use a parenthetical to get content from the ComputerNames.txt file (Make sure you have copied the ComputerNames.txt file to the root of drive C:\ before trying this) The results of the parenthetical should store the Computer Name(s) within the variable -Code a variable named "$Cred" and use a parenthetical with the Get-Credential cmdlet Run this line of code and it will prompt you for the Username and Password for the remote computer. The results of the parenthetical should store the Username and Password within the variable -Code a variable named "$SB4" and use a set of curly brackets {} to store all the commands you intend to send to the remote computers The scriptblock of commands should be stored within the variable -Have the remote computers do the following tasks (all these tasks should happen on remote computers): Use the Get-PSDrive cmdlet to retrieve info about the "C" drive Use a filter so that only results where the free space is less than 100 are returned Note: This syntax should be written within the $SB4 variable -Use invoke-command with the variables as input for the parameters -ComputerName, -ScriptBlock, and -Credential. -Pipe the results of invoke-command to other cmdlets locally to achieve the following tasks (all these tasks should happen locally): Sort by PSComputername (lowest to highest) Format-table with three properties -Custom Property "DriveLetter" (from the Name property) -Custom Property "FreeSpace" (from Free property) (Should be in GB, displayed as INT, and left aligned) -PSComputerName #>

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Seven Databases In Seven Weeks A Guide To Modern Databases And The NoSQL Movement

Authors: Luc Perkins, Eric Redmond, Jim Wilson

2nd Edition

1680502530, 978-1680502534

More Books

Students also viewed these Databases questions

Question

Differentiate the function. r(z) = 2-8 - 21/2 r'(z) =

Answered: 1 week ago

Question

How wide are Salary Structure Ranges?

Answered: 1 week ago