Info Security Memo
  • Blog
  • Sitemap
    • Categories
  • Contact
  • About
  • Resources
  • Tools
  • 51sec.org

Build Confidence

Focusing on Information Security 

Info Security Notes

Windows PowerShell Script Collection

2/20/2021

1 Comment

 
Windows PowerShell Script Collection

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:


Step 2: Source Code (One Line)

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)


2. Use Command Prompt

net user /domain USERNAME NEWPASS.
Run command prompt as administrator:
C:\Windows\system32>net user /domain admin2 Cyberark1
The command completed successfully.

C:\Windows\system32>

Replace USERNAME and NEWPASS with the actual username and a new password for this user.If the actual username consists of more than two words, place it inside quotation marks.




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
1 Comment
ID Verification link
12/26/2022 10:22:55

Thanks for sharing such a informative blog! Go global instantly, 16,000+ accurate documents out of the box. Access instant global coverage with our 16,000+ documents and 142 languages/typesets. Implemented OCR Labs as their identity verification process and saw application times and abandonment rates drop dramatically.

Reply



Leave a Reply.

    Categories

    All
    Architecture
    Blog
    Checkpoint
    Cisco
    Cloud
    CyberArk
    F5
    Fortigate
    Guardium
    Juniper
    Linux
    Network
    Others
    Palo Alto
    Qualys
    Raspberry Pi
    Security
    SIEM
    Software
    Vmware
    VPN
    Wireless

    Archives

    March 2024
    February 2024
    January 2024
    December 2023
    November 2023
    October 2023
    September 2023
    August 2023
    July 2023
    June 2023
    May 2023
    April 2023
    March 2023
    February 2023
    January 2023
    December 2022
    November 2022
    October 2022
    September 2022
    August 2022
    July 2022
    June 2022
    May 2022
    April 2022
    March 2022
    February 2022
    January 2022
    December 2021
    November 2021
    October 2021
    September 2021
    August 2021
    July 2021
    June 2021
    May 2021
    April 2021
    March 2021
    February 2021
    January 2021
    December 2020
    November 2020
    October 2020
    September 2020
    August 2020
    July 2020
    October 2019
    September 2019
    June 2019
    July 2018
    May 2018
    December 2017
    August 2017
    April 2017
    March 2017
    January 2017
    December 2016
    November 2016
    October 2016
    September 2016
    August 2016
    July 2016
    June 2016
    May 2016
    April 2016
    March 2016
    February 2016
    January 2016
    December 2015
    November 2015
    October 2015
    September 2015
    August 2015
    July 2015
    June 2015
    May 2015
    April 2015
    March 2015

    Print Page:

    RSS Feed

    Email Subscribe
Powered by Create your own unique website with customizable templates.
  • Blog
  • Sitemap
    • Categories
  • Contact
  • About
  • Resources
  • Tools
  • 51sec.org