0%

0/1 Lessons

Course Introduction

• 5min

0 / 2 lessons complete

Getting Started with Windows PowerShell

• 56min

0 / 8 lessons complete

Getting Help and Finding Commands

• 39min

0 / 6 lessons complete

PowerShell Command Syntax

• 33min

0 / 5 lessons complete

PowerShell Objects and Properties

• 35min

0 / 6 lessons complete

The PowerShell Pipeline

• 24min

0 / 2 lessons complete

PowerShell Providers

• 30min

0 / 5 lessons complete

PowerShell Arrays and Variables

• 28min

0 / 4 lessons complete

PowerShell Loops

• 19min

0 / 3 lessons complete

PowerShell Conditional Statements

• 11min

0 / 1 lessons complete

On Premises Lab Setup

• 36min

0 / 8 lessons complete

Basic Domain Administration with Windows PowerShell

• 2hr 27min

0 / 10 lessons complete

Send Emails with PowerShell

• 22min

0 / 2 lessons complete

PowerShell Desired State Configuration (DSC) Basics

• 1hr 48min

0 / 6 lessons complete

PowerShell Modules

• 58min

0 / 7 lessons complete

Powershell Challenges

• 1hr 55min

0 / 23 lessons complete

Course Conclusion

• 1min

0 / 1 lessons complete

Change a Password on a Remote Computer Answer

Instructions

Q&A (0)

Notes (0)

Resources (0)

Saving Progress...

Resources

There are no resources for this lesson.

Notes can be saved and accessed anywhere in the course. They also double as bookmarks so you can quickly review important lesson material.

Create note

Changing the password on a Remote Computer

  • From the Host, let’s say you wanted to change the password on a remote computer for a local user named rmatthews.
  • First, we would create a remote session:
    From the Host computer
    Open PowerShell ISE in Admin mode.
    I’ll go ahead and copy and paste this command

       Enter-PsSession -Computername VSC1 -Credential Administrator

Now I’ll go ahead and copy and paste the command to change the password.

$NewPassword = "TEG1!99gh" | ConvertTo-SecureString -AsPlainText -Force

Set-LocalUser -Name "rmatthews" -Password $NewPassword

Here is the Explanation:

  1. $NewPassword = "TEG1!99gh"

  This is the new password you want to set for the user "rmatthews." You can replace it with the desired  password.

| (pipe symbol): This is used to pass the plain text password to the ConvertTo-SecureString cmdlet as input.

ConvertTo-SecureString  This cmdlet is used to convert the plain text password provided on the left side of the pipe into a secure string. Here's what each part does:

-AsPlainText: This parameter tells PowerShell that the input password is in plain text format.

-Force: This parameter is used to suppress any confirmation prompts that may appear when converting the password to a secure string.

2. Set-LocalUser: This is a PowerShell cmdlet used to modify properties of a local user account. In this case, it's being used to change the password.

-Name "rmatthews": This parameter specifies the name of the user account you want to modify, which is "rmatthews" in this case.

-Password $NewPassword: This parameter sets the password for the user account. The $NewPassword variable contains the secure string obtained from step 1, which will be set as the new password for the "rmatthews" user.

So, when you run this script, it takes the plain text password "TEG1!99gh," converts it into a secure string, and then sets that secure string as the new password for the "rmatthews" user.

 Please note that using this approach, the password is still stored in memory as a secure string during the script's execution, which is more secure than storing it as plain text.

  • Verify the Password Change

You can verify that the password has been changed by attempting to log in with the new credentials on the remote computer.

In summary, the script is designed to securely set or change the password of a local user account on a Windows system.

Server Academy Members Only

Sorry, this lesson is only available to Server Academy Full Access members. Become a Full-Access Member now and you’ll get instant access to all of our courses.

0 0 votes
Lesson Rating
Subscribe
Notify of
profile avatar
0 Comments
Inline Feedbacks
View all comments