exam questions

Exam 70-742 All Questions

View all questions & answers for the 70-742 exam

Exam 70-742 topic 1 question 63 discussion

Actual exam question from Microsoft's 70-742
Question #: 63
Topic #: 1
[All 70-742 Questions]

Your network contains an Active Directory forest named contoso.com.
Your company plans to hire 500 temporary employees for a project that will last 90 days.
You create a new user account for each employee. An organizational unit (OU) named Temp contains the user accounts for the employees.
You need to prevent the new users from accessing any of the resources in the domain after 90 days.
What should you do?

  • A. Run the Get-ADOrganizationalUnit cmdlet and pipe the output to the Set-Date cmdlet.
  • B. Run the Get-ADOrganizationalUnit cmdlet and pipe the output to the Set-ADAccountPassword cmdlet.
  • C. Run the Get-ADUser cmdlet and pipe the output to the Set-ADAccountExpiration cmdlet.
  • D. Create a Group Policy object (GPO) and link the GPO to the Temp OU. Modify the Account Lockout Policy of the GPO.
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️
References:
https://docs.microsoft.com/en-us/powershell/module/addsadministration/set-adaccountexpiration?view=win10-ps

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Kobi1
4 years, 6 months ago
D is correct
upvoted 2 times
...
Mrtalha
5 years, 4 months ago
Yup in 44 the answer is: Run the Get-ADUser cmdlet and pipe the output to the Set-ADUser cmdlet
upvoted 2 times
GenjamBhai
4 years, 9 months ago
use Set-AdUser to modify the expiration date to end account access in 90 days
upvoted 2 times
...
...
coleman
5 years, 4 months ago
same question with 44 and the answer is different
upvoted 2 times
...
coleman
5 years, 4 months ago
answer C. Run the Get-ADUser cmdlet and pipe the output to the Set-ADAccountExpiration cmdlet is correct.
upvoted 3 times
coleman
5 years, 4 months ago
https://technet.microsoft.com/en-us/library/ee617256.aspx You can identify an account by its distinguished name, GUID, security identifier (SID), or Security Accounts Manager (SAM) account name. You can also set the Identity parameter to an object variable such as $<localADAccountObject>, or you can pass an account object through the pipeline to the Identity parameter. For example, you can use the Search-ADAccount cmdlet to retrieve an account object and then pass the object through the pipeline to the Set- ADAccountExpiration cmdlet. Similarly, you can use Get-ADUser, Get-ADComputer, or Get-ADServiceAccount cmdlets to retrieve account objects that you can pass through the pipeline to this cmdlet. For example, the complete command for this question is: Get-ADUser -Filter * -SearchBase "OU=Temp,DC=contoso,DC=com" | Set-ADAccountExpiration -TimeSpan 90.0:0 -TimeSpan<TimeSpan> Specifies a time interval that begins at the current time. The account expires at the end of the time interval. Specify the time interval in the following format: [-]D.H:M:S.F where: D = Days (0 to 10675199) H = Hours (0 to 23) M = Minutes (0 to 59) S = Seconds (0 to 59)
upvoted 3 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago