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 is an issue I've run into a few times, when running Install-Module -Scope CurrentUser <ModuleName> for the first time | |
| you need to install NuGet, but when you try to install it, you get the error... | |
| WARNING: Unable to download from URI 'https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409' to ''. | |
| WARNING: Unable to download the list of available providers. Check your internet connection. | |
| If you try to Invoke-WebRequest manually... | |
| Invoke-WebRequest "https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409" | |
| You get the error... |
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
| $ReplicaDirectoryServers = ((Get-ADDomain).ReplicaDirectoryServers|Sort-Object) | |
| $CurrentDate = Get-Date | |
| $ParsedOut = @() | |
| $ReplicaDirectoryServers | %{ | |
| Write-Host "Processing $($_)" -ForegroundColor Green | |
| $Events = Get-EventLog -ComputerName $_ -LogName "Directory Service" | where {$_.EventID -eq "2889"} | |
| $EventsCount = ($Events|Measure).Count | |
| Write-Host "Found $($EventsCount) events..." | |
| if($EventsCount -gt 0) { | |
| $Events | %{ |
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
| <# | |
| .Synopsis | |
| Approved a list of updates by their KB Numbers for a specified computer group | |
| .Description | |
| Interacts with an on-premise WSUS Server to enable an administrator to mass | |
| approve windows updates for a specific computer group. The script can be | |
| supplied with a comma-separated list of KB numbers, or a text file containing | |
| one KB number on each line. | |
| .Parameter WsusServer | |
| A string containing the FQDN of a WSUS server |
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-ADForest).GlobalCatalogs |%{Get-ADUser ethan.sterling -Server $_ -Properties LastLogonDate,PasswordLastSet}|Select SAMAccountName,LastLogonDate,PasswordLastSet |ft |
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-WindowsCapability -online | Where-Object {$_.Name -like "*RSAT*"} | Add-WindowsCapability -Online |
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
| <# | |
| Uncomment line 23 and 36 to enable functionality | |
| #> | |
| # Import list of users to remove | |
| $users = Get-Content '.\Input\UsersToRemove.txt' | |
| # Connect to MSOL | |
| $UserCredential = Get-Credential | |
| Write-Host "[~] " -ForegroundColor yellow -NoNewline; Write-Host "Connecting to MSOL services... " |
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
| Write-Host "[~] " -ForegroundColor Yellow -NoNewline; Write-Host "Checking MSOL Modules..." | |
| if (-not(Get-Command "Get-MsolDomain" -errorAction SilentlyContinue)) | |
| { | |
| Write-Host "[-] " -ForegroundColor red -NoNewline; Write-Host "MSOL module not found, installing..." | |
| Install-Module MSOnline -Scope CurrentUser | |
| } | |
| if (-not(Get-Command "Get-AzureADDomain" -errorAction SilentlyContinue)) | |
| { | |
| Write-Host "[-] " -ForegroundColor red -NoNewline; Write-Host "AzureAD module not found, installing..." | |
| Install-Module AzureAD -Scope CurrentUser |