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
$bootevents = Get-WinEvent -FilterHashtable @{logname="Microsoft-Windows-Diagnostics-Performance/Operational"; id=100} | |
$bootevent = [xml]$bootevents[0].ToXml() | |
$bootevent.Event.EventData.Data | |
$shutdownevents = Get-WinEvent -FilterHashtable @{logname="Microsoft-Windows-Diagnostics-Performance/Operational"; id=200} | |
$shutdownevent = [xml]$shutdownevents[0].ToXml() | |
$shutdownevent.Event.EventData.Data |
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
Install-Module -Name PSPKI | |
Import-Module -Name PSPKI | |
$cert = @(Get-ChildItem cert:\LocalMachine\My | Where-Object {$_.Subject -like "*CertificateSubject*"})[0] | |
Convert-PfxToPem -Certificate $cert -OutputFile "c:\temp\output.pem" |
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
$username = "typeusernamehere" | |
[datetime]::FromFileTime((Get-ADDomainController -Filter * | foreach {Get-ADUser $username -Properties LastLogon -Server $_.Name | select LastLogon} | Measure-Object -Property LastLogon -Maximum).Maximum) |
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
Install-Module -Name Az -AllowClobber -Scope CurrentUser | |
Import-Module Az | |
Connect-AzAccount |
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
vpncfg { | |
connections { | |
enabled = yes; | |
conn_type = conntype_lan; | |
name = "AzureToFritzBoxVPN"; | |
always_renew = no; | |
reject_not_encrypted = no; | |
dont_filter_netbios = yes; | |
localip = 0.0.0.0; | |
local_virtualip = 0.0.0.0; |
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
New-AzLocalNetworkGateway -Name AzureToFritzBoxVPN-LNG -ResourceGroupName AzureToFritzBoxVPN-RG -Location "West Europe" -fqdn "argq6adasd23ruo.myfritz.net" -AddressPrefix "10.1.1.0/24" |
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
Stop-Service SCVMMService | |
Stop-Service SCVMMAgent | |
C:\temp\kb5019202_vmmserver_amd64.msp | |
C:\temp\kb5019203_AdminConsole_amd64.msp | |
(Get-Item "C:\Program Files\Microsoft System Center\Virtual Machine Manager\bin\vmmservice.exe").VersionInfo |
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
$fsrm = New-Object -ComObject "Fsrm.FsrmReportManager" | |
enum FsrmReportLimit { | |
MaxFiles = 1 | |
MaxFileGroups = 2 | |
MaxOwners = 3 | |
MaxFilesPerFileGroup = 4 | |
MaxFilesPerOwner = 5 | |
MaxFilesPerDuplGroup = 6 | |
MaxDuplicateGroups = 7 |
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
$domainSearchList = Read-Host "Please enter a list of domain suffixes separated by semicolons (e.g. domain.local;domain.tld;int.domain.tld)" | |
$scopeToConfigure = Read-Host "Please enter the scope id of the scope to be configured (e.g. 192.168.1.0)" | |
$splittedDomainSearchList = $domainSearchList -split "\;" | |
$domainSearchListHexArray = @(); | |
Foreach ($domain in $splittedDomainSearchList) | |
{ | |
$splittedDomainParts = $domain -split "\." | |
Foreach ($domainPart in $splittedDomainParts) |
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
$store = New-Object System.Security.Cryptography.X509Certificates.X509Store "My","LocalMachine" | |
$store.Open(9) #ReadWrite + IncludeArchived | |
$store.Certificates |? Archived -eq $true | |
$store.Certificates |? Archived -eq $true |% {$_.Archived = $false} #Unarchive all certificates | |
$store.Certificates |? Subject -eq "CN=archivedcert" |% {$_.Archived = $false} #Unarchive certificates with given subject | |
$store.Close() |
NewerOlder