PrepAway - Latest Free Exam Questions & Answers

Which two Windows PowerShell commandsshould you run?

You install an Active Directory domain in a test environment.
You need to reset the passwords of all the user accounts in the domain from a domain controller.
Which two Windows PowerShell commandsshould you run?
(Each correct answer presents part of the solution, choose two.)

PrepAway - Latest Free Exam Questions & Answers

A.
$ newPassword = *

B.
Import-Module ActiveDirectory

C.
Import-Module WebAdministration

D.
Get- AdUser -filter * | Set- ADAccountPossword – NewPassword $ newPassword – Reset

E.
Set- ADAccountPassword – NewPassword – Reset

F.
$ newPassword = (Read-Host – Prompt “New Password” – AsSecureString )

G.
Import-Module ServerManager

Explanation:
First we create a variable, $newPassword, and prompt the user for the password to assign it to the variable.
Next we use Get-ADUser -filter *to collect all user accounts and pipe it through to SetADAccountPassword to assign the $newPassword variable to every account’s new password.
Note that Set- ADAccountPosswordmust be a typo.
Reference 1:
http://technet.microsoft.com/en-us/library/ee176935.aspx
Prompting a User to Enter Information
The Read-Host cmdlet enables you to interactively prompt a user for information. For example, this command
prompts the user to enter his or her name, then stores that name in the variable $Name (to answer the prompt,
type a name and then press ENTER):
$Name = Read-Host “Please enter your name”
Reference 2:
http://technet.microsoft.com/en-us/library/ee617241.aspx
Get-ADUser
Gets one or more Active Directory users.
Reference 3:
http://technet.microsoft.com/en-us/library/ee617261.aspx
Set-ADAccountPassword
Modifies the password of an Active Directory account.
Parameters
NewPassword
Specifies a new password value.
Reset
Specifies to reset the password on an account. Whenyou use this parameter, you must set the NewPassword
parameter. You do not need to specify the OldPassword parameter.


Leave a Reply