Question

Hello! I need help with this problem: Write a script that will let the user turn...

Hello! I need help with this problem: Write a script that will let the user turn off the ‘Password never expires” property of all local user accounts that are members of the Administrators local group. You may approach this in two phases – first, do it for all local user accounts, and then for only those in the Administrators group.

I'm having trouble on starting. I've been researching, but I haven't been able to find some solid information on it.

0 0
Add a comment Improve this question Transcribed image text
Answer #1
$ADS_UF_DONT_EXPIRE_PASSWD = 0x10000
$admin = [ADSI] "WinNT://$Env:USERDOMAIN/$Env:COMPUTERNAME/Administrator,User"
$flags = $admin.UserFlags[0]
if ( ($flags -band $ADS_UF_DONT_EXPIRE_PASSWD) -ne 0 ) {
  $flags = $flags -band (-bnot $ADS_UF_DONT_EXPIRE_PASSWD)
  $admin.UserFlags = $flags
  $admin.SetInfo()
}

Retrieve UserFlags (bit array), and if the bit is set, clear it. Reassign UserFlags with cleared bit, and write the change.

Add a comment
Know the answer?
Add Answer to:
Hello! I need help with this problem: Write a script that will let the user turn...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Hello, I need help labeling the following figure for my study guide You are the head...

    Hello, I need help labeling the following figure for my study guide You are the head of customer service at a consumer electronics company in Los Angeles, California. Aware that customer service is a major competitive advantage for your firm, you continually look for ways to improve seller-buyer relationships. Lately, you have been strategizing around ways to extend the availability of your customer call center hours in a cost-effective manner. You would like to be able to keep your call...

  • Hello in C#. I need help understanding and knwoing what i missed in my program. The...

    Hello in C#. I need help understanding and knwoing what i missed in my program. The issue is, the program is supposed to have user input for 12 family members and at the end of the 12 it asks for user to input a name to search for. When i put a correct name, it always gives me a relative not found message. WHat did i miss. And can you adjust the new code so im able to see where...

  • NEED HELP with HTML with Javascript embedding for form validation project below. I have my code...

    NEED HELP with HTML with Javascript embedding for form validation project below. I have my code below but I'm stuck with validation. If anyone can fix it, I'd really appreciate. ****************************************************************************** CODE: <!DOCTYPE html> <!-- To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor. --> <html> <head> <title>Nice</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script> var textFromTextArea; function getWords(){ var text =...

  • Need help identifying two organizational behaviors concepts/theories that apply to the organizational issue and the characters...

    Need help identifying two organizational behaviors concepts/theories that apply to the organizational issue and the characters in this chapter. We were unable to transcribe this image124 • The Ropes to Skip and the Ropes to Know give someone the benefit of the doubt, our individual ratings tend to be a bit hich When we found 20 percent of our people rated 'superior,' 50 percent 'above average 25 percent 'average,' and only 5 percent below average,' we knew something had to...

  • I need help modifying this code please ASAP using C++ Here is what I missed on this code below Here are the instruction...

    I need help modifying this code please ASAP using C++ Here is what I missed on this code below Here are the instructions Here is the code Produce correct70 pts O pts Full Marks No Marks results and statisfy requirements view longer Comments 1. Your display amount is not readable 2. I withdraw more than my balance, but I didn't see any error message description Documentations10 pts 0 pts Full Marks No Marks : comment i code and block comment...

  • Hello everyone, I'm having serious doubts about my answers for this activity and I need help....

    Hello everyone, I'm having serious doubts about my answers for this activity and I need help. Instructions for this activity: How would you synthesize the following substances starting from benzene? Assume that ortho- and para- substitution products can be separated. Show all reactions. My answers: 1 - 3 4 - 6 7 - 9 10 Your help will be much appreciated! 1. C-huelcony melly I heezerve OH 044 Freidel Crafts pikylation. CH₃ G Oxidation N20 + CH₂Cl AlCl₃ Benzene Phenol...

  • I need help making this in C++ Asap! If you feel information is missing, or provided...

    I need help making this in C++ Asap! If you feel information is missing, or provided information is incorrect, make assumptions but clearly state your assumptions. You should NEVER use global variables. Other than the main() function, there should be no global functions in your code. Other than the test() function not other function needs to be a static function in this problem. Let us say you find a consulting opportunity for a regional real-estate company that wants you to...

  • Please need serious and professional help! Hello! I am working on an "object oriented analysis and...

    Please need serious and professional help! Hello! I am working on an "object oriented analysis and design" Project. I would really need your sincere help in creating a vision document for this project. The Things That I require in the "vision document" is: 1. Product Overview [This section provides a high level view of the product capabilities, interfaces to other applications, and system configurations. This section usually consists of three subsections, as follows: •          Product perspective •          Product functions •         ...

  • In Real Life: Win-Win Problem Solving [ Silence ] [ Noises ] >> Can you be...

    In Real Life: Win-Win Problem Solving [ Silence ] [ Noises ] >> Can you be a little more quiet? I don't have class until 10 o'clock. I want to catch up on some sleep. >> Sorry to bother you. I am cleaning up last night's dinner dishes. >> Well, I wish you would do it a little more quietly. I was up late studying, >> Well if you would've washed them last night, I wouldn't have had to clean...

  • I need to do a cash receipts, cash payments, and cash budget, and a budgeted Balance...

    I need to do a cash receipts, cash payments, and cash budget, and a budgeted Balance Sheet with the above info. I did it myself already, but my numbers arent adding up. Edit: the balance sheet isnt adding up. I'm having trouble on the cash account entry. The wording on the accounts payable/accrued liability calculation is weird(f).Yes, cash is given for the previous quarter at 100,000. Edit2: Did u make a balance sheet, and then realize it didnt match? If...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT