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
throw "NotImplementedYet" |
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
using namespace System.Collections.Generic | |
function Show-Tree | |
{ | |
# .SYNOPSIS | |
# Print a tree given a key property and parent property | |
# | |
# .PARAMETER InputObject | |
# | |
# The object to print. |
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
$pullServer = Get-LabVM -Role DSCPullServer | |
$sqlServer = Get-LabVM -Role SQLServer2016 | |
$before = Invoke-LabCommand -ActivityName 'Get Row Count' -ComputerName $sqlServer -ScriptBlock { | |
Invoke-Sqlcmd -Database DSC -Query "SELECT COUNT(*) AS Count FROM StatusReport" | |
} -PassThru | |
Invoke-LabCommand -ActivityName 'Backup DSC Database' -ComputerName $sqlServer -ScriptBlock { | |
mkdir C:\SQLBackups -Force | |
$backupCmd = "BACKUP DATABASE [DSC] TO DISK = N'C:\SQLBackups\DSC {0:yyMMdd-hhmmss}.bak' WITH NOFORMAT, NOINIT, NAME = N'DSC-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10" -f (Get-Date) |
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 | |
Gets event log entries from remote computers using RPC/DCOM (same as connecting to remote computer from event log viewer MMC) | |
.DESCRIPTION | |
Gets event log entries from remote computers using RPC/DCOM (same as connecting to remote computer from event log viewer MMC) | |
.NOTES | |
-------------------------------------------------------------------------------- | |
Script author: Per Pedersen - [email protected] |
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
param( | |
[Parameter(Mandatory)] | |
[string]$Path | |
) | |
#Created by [email protected] | |
# | |
#Got keytab structure from http://www.ioplex.com/utilities/keytab.txt | |
# | |
# keytab { |
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 Unlock-AAAccount | |
{ | |
param( | |
[Parameter(Mandatory)] | |
[string]$Identity | |
) | |
try | |
{ | |
$user = Get-ADUser -Identity $Identity |
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 Connect-SupportSession | |
{ | |
param( | |
[Parameter(Mandatory)] | |
[string]$ComputerName, | |
[pscredential]$Credential | |
) | |
$s = New-PSSession @PSBoundParameters -ConfigurationName Support #-ErrorAction SilentlyContinue |
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
$types = @' | |
using System; | |
namespace Kerberos | |
{ | |
public enum EncryptionTypes:uint | |
{ | |
AES256_CTS_HMAC_SHA1_96 = 18, | |
AES128_CTS_HMAC_SHA1_96 = 17, | |
ARCFOUR_HMAC_MD5 = 23, |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<Configuration> | |
<ViewDefinitions> | |
<View> | |
<Name>Microsoft.PowerShell.Commands.GenericMeasureInfo</Name> | |
<ViewSelectedBy> | |
<TypeName>Microsoft.PowerShell.Commands.GenericMeasureInfo</TypeName> | |
</ViewSelectedBy> | |
<ListControl> | |
<ListEntries> |
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
#usually the process consuming the most memory is the one that hosts the LCM | |
$p = Get-Process -Name WmiPrvSE | Sort-Object -Property WS -Descending | Select-Object -First 1 | |
Enter-PSHostProcess -Process $p -AppDomainName DscPsPluginWkr_AppDomain | |
Start-Sleep -Seconds 1 | |
$rs = Get-Runspace | Where-Object { $_.Debugger.InBreakpoint } | |
Debug-Runspace -Runspace $rs |
OlderNewer