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
$ComputerSystem = (Get-CimInstance Win32_ComputerSystem) | |
$FqDn = "$($ComputerSystem.Name).$($ComputerSystem.Domain)" | |
$HybridWorkerGroup = Get-AzureRmAutomationAccount | Get-AzureRMAutomationHybridWorkerGroup | Where-Object { $FqDn -in $_.RunbookWorker.Name } | |
$HybridWorkerGroup.RunbookWorker.Name |
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
function ConvertFrom-Xml { | |
<# | |
.SYNOPSIS | |
Converts XML object to PSObject representation for further ConvertTo-Json transformation | |
.EXAMPLE | |
# JSON->XML | |
$xml = ConvertTo-Xml (get-content 1.json | ConvertFrom-Json) -Depth 4 -NoTypeInformation -as String | |
.EXAMPLE | |
# XML->JSON | |
ConvertFrom-Xml ([xml]($xml)).Objects.Object | ConvertTo-Json |
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
Import-Module ADSync | |
# Your AAD Credentials | |
$Credential = Get-Credential | |
# Disable the deletion threshold | |
Disable-ADSyncExportDeletionThreshold -AADCredential $Credential | |
# Sync changes | |
Start-ADSyncSyncCycle -PolicyType Delta | |
# Enable deletion threshold with default value of 500 | |
Enable-ADSyncExportDeletionThreshold -AADCredential $Credential -DeletionThreshold 500 |
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
# Clear Computer Kerberos tickets | |
klist -li 0x3e7 purge | Out-Null | |
# Clear certutil cache | |
certutil -f -policyserver * -policycache delete | Out-Null |
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
SELECT | |
[QueueTime], | |
[StartTime], | |
[EndTime], | |
[Result], | |
[QueuedReasons] = CASE jobHist.[QueuedReasons] | |
WHEN 1 THEN N'Scheduled' | |
WHEN 2 THEN N'Manual' | |
ELSE 'Unknown' | |
END, |
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-ADComputer -Filter { servicePrincipalName -like "MSServerCluster*"} | Select-Object DNSHostName |
NewerOlder