This file contains 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-ADGroupMember -Identity "GroupName" | Get-ADUser -Properties EmailAddress | Select-Object -ExpandProperty EmailAddress | Out-GridView |
This file contains 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
# Define the commands to be scheduled | |
$commands = @( | |
"winget upgrade --all --accept-source-agreements --accept-package-agreements", | |
"choco upgrade all -y" | |
) | |
# Define common task properties | |
$taskAction = New-ScheduledTaskAction -Execute 'powershell.exe' -Argument '{0}' | |
foreach ($command in $commands) { |
This file contains 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
winget upgrade --all --accept-source-agreements --accept-package-agreements ; choco upgrade all -y |
This file contains 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-package *secureworks* | Uninstall-Package |
This file contains 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-DnsServerResourceRecord -computername DC1 -ZoneName zone.domain.com | Select-Object Hostname,TimeStamp,RecordType,@{Name="IPv4Address";Expression={ [version]$_.RecordData.IPv4Address.IPAddressToString }} | Sort-Object IPv4Address | export-csv -path c:\temp\dns1sort.csv |
This file contains 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-CimInstance -ClassName Win32_OperatingSystem | Select LastBootUpTime |
This file contains 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
winget install -e --id Microsoft.WindowsAdminCenter |
This file contains 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 -Name RSAT* -Online | Add-WindowsCapability -Online |
This file contains 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
# Remote EAC Shell | |
# from: https://docs.microsoft.com/en-us/powershell/exchange/connect-to-exchange-servers-using-remote-powershell?view=exchange-ps | |
# Get Credentials | |
$UserCredential = Get-Credential | |
# Set Session | |
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://<ServerFQDN>/PowerShell/ -Authentication Kerberos -Credential $UserCredential | |
# Connect Session |
This file contains 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
enter-pssession $computername -credential (get-credential) |
NewerOlder