{"id":15202882,"url":"https://github.com/sv866729/powershell","last_synced_at":"2026-02-02T14:11:40.915Z","repository":{"id":241453682,"uuid":"804910781","full_name":"sv866729/Powershell","owner":"sv866729","description":"This repository provides a variety of PowerShell scripts for different use cases. Whether you need to conduct a security audit, automate repetitive tasks, or manage Office , you'll find useful scripts here. Each script is designed to be modular and easy to adapt to your needs.","archived":false,"fork":false,"pushed_at":"2025-04-22T14:20:04.000Z","size":179,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-22T15:33:20.528Z","etag":null,"topics":["active-directory","automation","office365","powershell","powershell-module","powershell-script","security-tools"],"latest_commit_sha":null,"homepage":"https://www.linkedin.com/in/samuel-v-656034279/","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sv866729.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-05-23T14:04:49.000Z","updated_at":"2025-04-22T14:20:08.000Z","dependencies_parsed_at":"2024-10-23T03:55:25.615Z","dependency_job_id":"c68aecfe-bfe5-4d4e-8fe5-3b4846f3b822","html_url":"https://github.com/sv866729/Powershell","commit_stats":{"total_commits":69,"total_committers":1,"mean_commits":69.0,"dds":0.0,"last_synced_commit":"b314fab88091d5637614b3d8e04d312f5e57adaa"},"previous_names":["sv866729/powershell-stuff"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sv866729/Powershell","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sv866729%2FPowershell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sv866729%2FPowershell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sv866729%2FPowershell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sv866729%2FPowershell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sv866729","download_url":"https://codeload.github.com/sv866729/Powershell/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sv866729%2FPowershell/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260690833,"owners_count":23047099,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["active-directory","automation","office365","powershell","powershell-module","powershell-script","security-tools"],"created_at":"2024-09-28T04:07:00.385Z","updated_at":"2026-02-02T14:11:40.876Z","avatar_url":"https://github.com/sv866729.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PowerShell Scripts Repository\n\nThanks for checking out my PowerShell repository! This repository contains a collection of PowerShell scripts that I have created over my career and thought would be beneficial to the community.\n\n## Table of Contents\n- [Introduction](#introduction)\n- [Getting Started](#getting-started)\n- [Scripts Overview](#scripts-overview)\n- [Usage](#usage)\n- [Contributing](#contributing)\n- [License](#license)\n- [Contact](#contact)\n\n## Introduction\n\nThis repository provides a variety of PowerShell scripts for different use cases. Whether you need to conduct a security audit, automate repetitive tasks, or manage Office, you'll find useful scripts here. Each script is designed to be modular and easy to adapt to your needs.\n\n## Getting Started\n\nTo get started with the scripts in this repository:\n\n1. **Clone the Repository**: \n    ```bash\n    git clone https://github.com/sv866729/Powershell-Stuff\n    ```\n2. **Navigate to the Directory**:\n    ```bash\n    cd Powershell-Stuff\n    ```\n\n3. **Open PowerShell**: Ensure you are using PowerShell with appropriate execution policies. You might need to adjust the policy to allow script execution:\n    ```powershell\n    Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser\n    ```\n\n## Scripts Overview\n\n### AD Related\n\n#### `Get-AliasAllUsers.ps1`\n\n- **Description**: Gets all AD users and their proxy addresses.\n- **Usage**: \n    ```powershell\n    Get-AliasAllUsers -ou \"OU=Users,DC=example,DC=com\"\n    ```\n- **Dependencies**: Run the script to load the function into a session.\n- **Notes**: This script does not execute by default and is only a function.\n\n#### `Remove-AliasAllUsers.ps1`\n\n- **Description**: Removes an alias from all users in the specified domain.\n- **Usage**: \n    ```powershell\n    Remove-AliasAllUsers -domain \"domain.com\" -ou \"OU=Users,DC=example,DC=com\"\n    ```\n- **Dependencies**: Run the script to load the function into a session.\n- **Notes**: This script does not execute by default and is only a function.\n\n#### `Set-NewAliasAllUsers.ps1`\n\n- **Description**: Sets a new alias for all users based on the specified criteria.\n- **Usage**: \n    ```powershell\n    Set-NewAliasAllUsers -domain \"domain.com\" -ou \"OU=Users,DC=example,DC=com\"\n    ```\n- **Dependencies**: Run the script to load the function into a session.\n- **Notes**: This script does not execute by default and is only a function.\n\n### Building Blocks\n\n#### `download-install.ps1`\n\n- **Description**: Downloads a file from a specified URL and initiates its installation.\n- **Usage**: \n    ```powershell\n    download-install -url \"https://example.com/file.exe\"\n    ```\n- **Dependencies**: Run the script to load the function into a session.\n- **Notes**: This script does not execute by default and is only a function.\n\n#### `error-handling.ps1`\n\n- **Description**: Executes a command and handles errors gracefully, providing customizable messages for success and failure.\n- **Usage**: \n    ```powershell\n    error-handling -command \"YourCommandHere\"\n    ```\n- **Dependencies**: Run the script to load the function into a session.\n- **Notes**: This script does not execute by default and is only a function.\n\n#### `Generate-Passphrase.ps1`\n\n- **Description**: Generates a passphrase using a specified word list and number of words, appending a random number at the end.\n- **Usage**: \n    ```powershell\n    Generate-Passphrase -wordlist @(\"word1\", \"word2\", \"word3\") -wordcount 4\n    ```\n- **Dependencies**: Run the script to load the function into a session.\n- **Notes**: This script does not execute by default and is only a function.\n\n#### `Generate-Username.ps1`\n\n- **Description**: Generates usernames based on first and last names from a CSV file, optionally adding a random number to each username.\n- **Usage**: \n    ```powershell\n    Generate-Usernames -csvpath \"C:\\path\\to\\your\\file.csv\"\n    ```\n- **Dependencies**: Run the script to load the function into a session.\n- **Notes**: This script does not execute by default and is only a function.\n\n#### `Get-HexCode.ps1`\n\n- **Description**: Converts a decimal value to its hexadecimal representation, formatted to an 8-character code with leading zeros.\n- **Usage**: \n    ```powershell\n    Get-HexCode -decimalvalue 123\n    ```\n- **Dependencies**: Run the script to load the function into a session.\n- **Notes**: This script does not execute by default and is only a function.\n\n#### `Install-ModuleIfNeeded.ps1`\n\n- **Description**: Checks if a PowerShell module is installed and installs it if not already present.\n- **Usage**: \n    ```powershell\n    Install-ModuleIfNeeded -ModuleName \"ModuleName\"\n    ```\n- **Dependencies**: Run the script to load the function into a session.\n- **Notes**: This script does not execute by default and is only a function.\n\n### Microsoft 365 Related\n\n#### `BlockingAllSignIns365MSOL.ps1`\n\n- **Description**: Connects to Microsoft Online Services and blocks credentials for all users.\n\n#### `EnableSecDefaultsGRAPH.ps1`\n\n- **Description**: Installs the Microsoft.Graph.Identity.SignIns module, connects to Microsoft Graph, ensures Security Defaults are enabled, and handles authentication and status checks.\n\n#### `EnforcingLegacyMfaGRAPH.ps1`\n\n- **Description**: Connects to Microsoft Graph, retrieves all users, and enforces Multi-Factor Authentication (MFA) for each user via the Microsoft Graph API.\n\n#### `Remove-InboxRulesByNameEXCH.ps1`\n\n- **Description**: Connects to Exchange Online, retrieves all user mailboxes, and removes any inbox rules containing a specified string.\n- **Usage**: \n    ```powershell\n    Remove-InboxRulesByName -RuleNameSubstring \"(Migrated)\"\n    ```\n- **Dependencies**: Run the script to load the function into a session.\n- **Notes**: This script does not execute by default and is only a function.\n\n#### `Reset-M365UserPasswordsMSOL.ps1`\n\n- **Description**: Connects to Microsoft Online Services, retrieves all users, resets passwords (excluding specified admin account), and exports the list of new passwords to a CSV file.\n- **Usage**: \n    ```powershell\n    Reset-UserPasswords -AdminAccount \"admin@example.com\" -FilePath \"C:\\Path\\To\\Save\\passwordlist.csv\"\n    ```\n- **Dependencies**: Run the script to load the function into a session.\n- **Notes**: This script does not execute by default and is only a function.\n\n#### `Reset-MFAForAllUsersMSOL.ps1`\n\n- **Description**: Connects to Microsoft Online Services and resets Multi-Factor Authentication (MFA) options for all users.\n- **Usage**: \n    ```powershell\n    Reset-MFAForAllUsers\n    ```\n- **Dependencies**: Run the script to load the function into a session.\n- **Notes**: This script does not execute by default and is only a function.\n\n#### `Revoke-SessionsForAllUsersGRAPH.ps1`\n\n- **Description**: Connects to Microsoft Graph and revokes sign-in sessions for all users.\n- **Usage**: \n    ```powershell\n    Revoke-SessionsForAllUsers\n    ```\n- **Dependencies**: Run the script to load the function into a session.\n- **Notes**: This script does not execute by default and is only a function.\n\n### Windows Security Related\n\n#### `Disable-WeakCiphers.ps1`\n\n- **Description**: Disables a list of weak cipher suites on a Windows machine, handling errors and providing feedback.\n- **Usage**: \n    ```powershell\n    Disable-WeakCiphers\n    ```\n- **Dependencies**: Run the script to load the function into a session.\n- **Notes**: This script does not execute by default and is only a function.\n\n#### `Get-EventMetadata.ps1`\n\n- **Description**: Retrieves detailed metadata for a specific event from the Windows Event Log and returns it as a `PSCustomObject`.\n- **Usage**: \n    ```powershell\n    Get-EventMetadata -EventId 4672 -LogName \"Security\"\n    ```\n- **Dependencies**: Run the script to load the function into a session.\n- **Notes**: This script does not execute by default and is only a function.\n\n#### `Get-PortProcess.ps1`\n\n- **Description**: Retrieves detailed information about the process listening on a specified TCP port, including process, parent process, executable file properties, and digital signature details.\n- **Usage**: \n    ```powershell\n    Get-PortProcess -Port 80\n    ```\n- **Dependencies**: Run the script to load the function into a session.\n- **Notes**: This script does not execute by default and is only a function.\n\n## Usage\n\nOpen PowerShell and navigate to the script's location. Execute the script with the required parameters using the details listed in the [Scripts Overview](#scripts-overview) section and the header of the script.\n\n## Contributing\n\nHelp Wanted! Feel free to contribute by following these steps:\n\n1. **Fork the Repository**: Click the [Fork](https://github.com/sv866729/Powershell-Stuff/fork) button on GitHub to create your own copy.\n2. **Create a Branch**: \n    ```bash\n    git checkout -b feature/your-feature\n    ```\n3. **Make Changes**: Edit or add scripts as needed.\n4. **Commit Changes**:\n    ```bash\n    git add .\n    git commit -m \"Add a descriptive message about your changes\"\n    ```\n5. **Push to the Branch**:\n    ```bash\n    git push origin feature/your-feature\n    ```\n6. **Create a Pull Request**: Go to the repository on GitHub and [create a pull request](https://github.com/sv866729/Powershell-Stuff/compare) with a clear description of your changes.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Contact\n\nFor any questions or support, please reach out to:\n\n- **Author**: [Samuel Valdez](https://www.linkedin.com/in/samuel-v-656034279/)\n- **GitHub**: [Sv866729](https://github.com/sv866729/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsv866729%2Fpowershell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsv866729%2Fpowershell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsv866729%2Fpowershell/lists"}