This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Function Get-Inventory { | |
| <# | |
| .SYNOPSIS | |
| Gets a variety of computer information remotely and exports it to | |
| a CSV file. | |
| .PARAMETER Computers | |
| Specifies the Computer names of devices to query | |
| .INPUTS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Install Chocolatey | |
| Invoke-Command -ComputerName DC -ScriptBlock { | |
| Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | |
| choco feature enable -y allowGlobalConfirmation | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # You must have Chocolately installed first | |
| # Usage example | |
| # Install-MySoftware -Computers dc1,dc2,svr12,svr16 -Packages 'powershell.portable','microsoft-edge','microsoft-windows-terminal' | |
| Function Install-MySoftware { | |
| [CmdletBinding()] | |
| Param( | |
| [Parameter()] | |
| [string[]]$Computers, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Get all Modules, Functions, Alias' ...etc available on your computer | |
| Get-Command -all | |
| # Search for all cmdlets that contain Service in the noun portion. | |
| Get-command –noun Service | |
| # Search for all cmdlets that contain Stop in the verb portion | |
| Get-Command -Verb Stop | |
| # You can also use the * character as a wildcard |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Update all of the helpfiles | |
| Update-Help | |
| # Find all the modules that accept updated help | |
| Get-Module -ListAvailable | Where-Object HelpInfoUri | |
| # Save the help files to the local machine | |
| Save-help -Force -DestinationPath 'D:\SaveHelp' | |
| # Use either command below to access helpfiles |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # *** THIS SCRIPT IS PROVIDED WITHOUT WARRANTY, USE AT YOUR OWN RISK *** | |
| <# | |
| .DESCRIPTION | |
| Starts the Windows Update service (wuauserv) if it is stopped and forces a checkin with the WSUS Server. | |
| This function uses the Invoke-Command CMDlet which will require PSRemoting to be enabled on the target machine. | |
| .NOTES | |
| File Name: force-WSUScheckin.ps1 | |
| Author: David Hall | |
| Contact Info: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| .DESCRIPTION | |
| Uses some WMI and reading some Registry keys to get the version numbers for | |
| McAfee Security Center, DAT, HIP, Plash Player, Java, Adobe Acrobat, Reader and AIR. | |
| All of the results are put into a CSV file with the computername, IP Address, MAC Address and Serial Number | |
| .NOTES | |
| File Name: get-3rdPartySoftware.ps1 | |
| Author: David Hall | |
| Contact Info: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Configuration SecurePullServerSQLDBgMSA { | |
| Param ( | |
| [ValidateNotNullOrEmpty()] | |
| [ string ] $NodeName = 'localhost', | |
| [ValidateNotNullOrEmpty()] | |
| [ string ] $Thumbprint = " $( Throw "Provide a valid certificate thumbprint to continue" ) ", | |
| [ValidateNotNullOrEmpty()] | |
| [ string ] $Guid = " $( Throw "Provide a valid GUID to continue" ) " |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Function New-AzureLab { | |
| <# | |
| .SYNOPSIS | |
| New-AzureLab will create 1 or multiple VMs in Azure based on input parameters from a CSV | |
| .DESCRIPTION | |
| Create a CSV file like below: | |
| VMName,Location,InterfaceName,ResourceGroupName,VMSize,ComputerName | |
| SP,EastUS,SP_Int,SignalWarrant_RG,Basic_A2,SP |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Run this once to get the Domain Admins group baseline | |
| Get-ADGroupMember -Server signalwarrant.local -Identity "Domain Admins" | | |
| Select-Object -ExpandProperty samaccountname | | |
| Export-Clixml -Path 'C:\scripts\CurrentDomainAdmins.xml' |