Starting to collect some PowerShell scripts for references. There are lots of them can be found from the references section.
Export a Computer List from Active Directory
Step 1: Run Powershell ISE
Open the Powershell ISE → Run the following script, adjusting the path for the export:
Get-ADComputer -Filter * -Property * | Select-Object Name,OperatingSystem,OperatingSystemVersion,ipv4Address | Export-CSV ADcomputerslist.csv -NoTypeInformation -Encoding UTF8
Reset Domain User's Password
1. Using Powershell
Set-ADAccountPassword -Identity admin2 -Reset -NewPassword (ConvertTo-SecureString -AsPlainText "Cyberark1" -Force)
Set-ADAccountPassword -Identity admin3 -Reset -NewPassword (ConvertTo-SecureString -AsPlainText "Cyberark1" -Force)
Set-ADAccountPassword -Identity auditor1 -Reset -NewPassword (ConvertTo-SecureString -AsPlainText "Cyberark1" -Force)
Set-ADAccountPassword -Identity auditor2 -Reset -NewPassword (ConvertTo-SecureString -AsPlainText "Cyberark1" -Force)
Set-ADAccountPassword -Identity test1 -Reset -NewPassword (ConvertTo-SecureString -AsPlainText "Cyberark1" -Force)
Set-ADAccountPassword -Identity test2 -Reset -NewPassword (ConvertTo-SecureString -AsPlainText "Cyberark1" -Force)
Set-ADAccountPassword -Identity test3 -Reset -NewPassword (ConvertTo-SecureString -AsPlainText "Cyberark1" -Force)
Set-ADAccountPassword -Identity vaultadmin1 -Reset -NewPassword (ConvertTo-SecureString -AsPlainText "Cyberark1" -Force)
Set-ADAccountPassword -Identity vaultadmin2 -Reset -NewPassword (ConvertTo-SecureString -AsPlainText "Cyberark1" -Force)
Run command prompt as administrator:
C:\Windows\system32>net user /domain admin2 Cyberark1
The command completed successfully.
C:\Windows\system32>
References
- /u/jacfearsome https://github.com/JacFearsome/powershell-scripts
- /u/PowerMonkey500 https://github.com/AndrewEllis93/PowerShell-Scripts
- /u/unibody https://github.com/jwmoss/powershell_scripts
- /u/IDA_noob https://github.com/tylerapplebaum?tab=repositories
- /u/mikedopp https://github.com/mikedopp
- /u/JBear_Alpha https://github.com/Average-Bear
- /u/BornToBeRoot https://github.com/BornToBeRoot/PowerShell
- /u/ramblingcookiemonste https://github.com/RamblingCookieMonster/PowerShell
- /u/jhulbe https://github.com/jhulbe/Powershell
- jrussellfreelance/powershell-scripts
via Blogger https://ift.tt/3k4qj6V
February 19, 2021 at 09:42PM Windows