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 Get-InstalledSoftware { | |
[cmdletbinding()] | |
param( | |
[parameter(ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] | |
[string[]]$ComputerName = $env:ComputerName | |
) | |
begin { | |
$UninstallRegKey = 'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall' | |
} |
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 Get-LogonReport { | |
param($ComputerName = $Env:COMPUTERNAME) | |
$filterXml = '<QueryList><Query Id="0" Path="Security"><Select Path="Security">*[System[(EventID=4624)]]</Select></Query></QueryList>' | |
$logonTypes = @{ | |
2 = 'Interactive' | |
3 = 'Network' | |
4 = 'Batch' | |
5 = 'Service' | |
6 = 'Proxy' |
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
# The identity to add permissions for | |
$Identity = "myDomain\nonAdmins" | |
# The configuration name to change permissions to (default is 'microsoft.powershell') | |
$sessionConfigurationName = 'microsoft.powershell' | |
# Get the current permissions on the default endpoint | |
$sddl = (Get-PSSessionConfiguration -Name $sessionConfigurationName).SecurityDescriptorSddl |
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 Get-CertificateFromCredential { | |
param([PSCredential]$Credential) | |
Add-Type -TypeDefinition @' | |
using System; | |
using System.Runtime.InteropServices; | |
public static class NativeMethods { |
NewerOlder