We help IT Professionals succeed at work.
Troubleshooting Question

How do you create a CVS file in Powershell for users

59 Views
Last Modified: 2020-10-08
How do I enter specific users into a CVS file that I am going to use in a Powershell

Examples would be appreciated.    What I am going to do is run the Powershell to reset the users password to 0 so their password will be required to be reset.
Comment
Watch Question

CERTIFIED EXPERT
Most Valuable Expert 2019
Most Valuable Expert 2018
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
J.R. SitmanIT Director

Author

Commented:
I've never created a CVS file.   Could you send an example with two columns?
CERTIFIED EXPERT
Most Valuable Expert 2019
Most Valuable Expert 2018
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
J.R. SitmanIT Director

Author

Commented:
ok.   Where do I save the CVS file?    In the script, I cannot tell where it will find it.
CERTIFIED EXPERT
Most Valuable Expert 2019
Most Valuable Expert 2018

Commented:
Wherever you want; that's what the $inFile variable is for.
The $outFile variable will contain the log.
J.R. SitmanIT Director

Author

Commented:
I created the CSV for one user.   Ran the script in Powershell and it stated processing dmolino (That is the user) however, I was able to log on with her old password.
CERTIFIED EXPERT
Most Valuable Expert 2019
Most Valuable Expert 2018

Commented:
Look into the file in $outFile, it will have the results.
I updated the script above so that the results will be shown in the console as well; just download again.
J.R. SitmanIT Director

Author

Commented:
Here are the results.

The term 'Set-ADAccountPassword' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
CERTIFIED EXPERT
Most Valuable Expert 2019
Most Valuable Expert 2018

Commented:
Are you running this on Server 2008 R2?
What's the latest server version (member servers included) you have running in that AD?
J.R. SitmanIT Director

Author

Commented:
I run it from a 2012 terminal server. I can try it on a different server
CERTIFIED EXPERT
Most Valuable Expert 2019
Most Valuable Expert 2018
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
J.R. SitmanIT Director

Author

Commented:
I'll try later today. Thanks for helping on Sunday
J.R. SitmanIT Director

Author

Commented:
getting the attached error

reset error
CERTIFIED EXPERT
Most Valuable Expert 2019
Most Valuable Expert 2018

Commented:
Look at my script again - that's supposed to say "-NoTypeInformation"
J.R. SitmanIT Director

Author

Commented:
If fixed the script.,   see results.  I installed both of the items you told me to on a 2016 DC

The term 'Set-ADAccountPassword' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
CERTIFIED EXPERT
Most Valuable Expert 2019
Most Valuable Expert 2018
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
J.R. SitmanIT Director

Author

Commented:
results
CERTIFIED EXPERT
Most Valuable Expert 2019
Most Valuable Expert 2018
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
J.R. SitmanIT Director

Author

Commented:
Thanks
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.