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-UserPasswordStatus { | |
Param( | |
[int]$ExpiryThreshold=10, | |
[switch]$ExpiringOnly | |
) | |
$Config = @{ | |
ExpiringSoonThresholdDays = $ExpiryThreshold | |
PasswordExpiryAge = Get-ADDefaultDomainPasswordPolicy | select -ExpandProperty MaxPasswordAge | |
ResultFilter = $( | |
if ($ExpiringOnly){ |
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 New-DynamicParams { | |
Param( | |
[Parameter(Mandatory=$true)] | |
[Int] | |
$count, | |
[Parameter(Mandatory=$true)] | |
[PSCustomObject[]] | |
$settings | |
) | |
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 New-COMPANYUser { | |
[CmdletBinding(SupportsShouldProcess=$true)] | |
Param( | |
[Parameter(Mandatory=$True,Position=0)] | |
$FirstName, | |
[Parameter(Mandatory=$True,Position=1)] | |
$LastName, | |
[Parameter(Mandatory=$False,Position=2)] | |
$Nickname, | |
[Parameter(Mandatory=$False,Position=3)] |
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 Convert-HGSTSerial { | |
Param( | |
[Parameter(Mandatory = $True)] | |
[string]$Serial | |
) | |
$Serial = $Serial.ToUpper() | |
$ZeroIndexLength = ($Serial.Length - 1) | |
$TranslationTable = @( | |
@{ |
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 Switch-RDPCert { | |
[cmdletbinding()] | |
Param( | |
[Parameter()] | |
$SourceStoreScope = 'LocalMachine', | |
[Parameter()] | |
$SourceStoreName = 'My', | |
[Parameter()] | |
$DestStoreScope = 'LocalMachine', | |
[Parameter()] |
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
/* Hide main tabs toolbar */ | |
#main-window[tabsintitlebar="true"]:not([extradragspace="true"]) #TabsToolbar { | |
opacity: 0; | |
pointer-events: none; | |
} | |
#main-window:not([tabsintitlebar="true"]) #TabsToolbar { | |
visibility: collapse !important; | |
} | |
/* Sidebar min and max width removal */ |
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
DROP TABLE IF EXISTS [DATABASENAMEHERE].[dbo].[WinEvent] | |
GO | |
CREATE TABLE [DATABASENAMEHERE].[dbo].[WinEvent] ( | |
[id] int IDENTITY(1,1), | |
[TimeCreated] datetime NOT NULL, | |
[LogName] varchar(60) NOT NULL UNIQUE, | |
[ProviderName] varchar(100) NOT NULL, | |
[EventId] integer NOT NULL, | |
[LevelDisplayName] varchar(100), |
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
$FormLogin = New-UDAuthenticationMethod -Endpoint { | |
param([PSCredential]$Credentials) | |
Import-Module ADAuth | |
$AuthorizedGroup = 'Administrators' | |
if ($Credentials | ? {$_ | Test-ADCredential} | Test-ADGroupMembership -TargetGroup $AuthorizedGroup) { | |
New-UDAuthenticationResult -Success -UserName $Credentials.UserName | |
} |
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
#REALLY rough, here be dragons. Still faster than doing it manually though. | |
$STList = @( | |
#Service Tags Go Here | |
'XXXXXXX', | |
'XXXXXXX' | |
) | |
$ResultTable = [System.Collections.ArrayList]::new() | |
$STList | %{ |
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
Param( | |
$HomeFoldersDirectoryPath = 'C:\Default\Path\Here\' | |
) | |
$HomeFolders = Get-ChildItem $HomeFoldersDirectoryPath -Directory | |
foreach ($HomeFolder in $HomeFolders) { | |
$Path = $HomeFolder.FullName | |
$Acl = (Get-Item $Path).GetAccessControl('Access') | |
$Username = $HomeFolder.Name | |
$Ar = New-Object System.Security.AccessControl.FileSystemAccessRule($Username, 'Modify', 'ContainerInherit,ObjectInherit', 'None', 'Allow') | |
$Acl.SetAccessRule($Ar) |