Hello to all,
Hope you can help me.
I need to run powershell script on Active directory server and change users that have an expiration date to none.
I found the command and it is working good, but don't know how to do it to for multiple users.
Here you can start learning PowerShell for free: Microsoft Virtual Academy – Getting Started with Microsoft PowerShell.
If you then have a specific problem with some code you wrote or with a cmdlet you don't understand you can come back here and we will try to answer your questions. But I think it is beyond the scope of this forum to write a script for you or to teach you one cmdlet at a time how to write scripts.
Good luck and have a lot of fun.
Thank you for taking the time to answer.
I do have a basic knowledge of Powershell commands, but having difficulties composing scripts from scratch.
I did try to find a similar script in the examples and other places, but didn't find exactly what i needed.
For me these two statements contradict each other.
What did you search for and where? I posted 2 links in my first answer where you can find scripts.
That's ne normal case I think. You always will have to adapt scripts found in the internet for your specific needs and environment.
There is no need to do this from scratch.
You could use the ADAC to click through this type of config and the ADAC will write this code for you, which you can save and tweak to your needs for future use cases. See:
Introduction to Active Directory Administrative Center Enhancements
Use Active Directory Administrative Center to Create PowerShell Commands in
Step-By-Step: Utilizing PowerShell History Viewer in Windows Server 2012 R2
You can use below code to identify the users
Import-Csv c:\users.csv | ForEach
You must be logged in to reply to this topic.