Initial commit

This commit is contained in:
2026-02-11 14:24:03 +01:00
parent 03677dd0cc
commit c17917ebfb
25 changed files with 5986 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
function TK_Confirm-DomainAdmin {
<#
.SYNOPSIS
Confirm Domain Admin
.DESCRIPTION
Check if user is domain admin
.PARAMETER UserName
user to check, if not given current user is used
.EXAMPLE
TK_Confirm-DomainAdmin -UserName Thomas
Check if "Thomas" is domain admin
.EXAMPLE
TK_Confirm-DomainAdmin
Check if current user is domain admin
#>
[cmdletbinding()]
param (
$UserName = $env:USERNAME
)
begin {
$domainadmins = (Get-ADGroupMember 'domain admins').samaccountname
}
process {
foreach ($user in $UserName) {
if ($user -in $domainadmins) {
Write-Verbose "$User is a member of the domain admins group"
$domainadmin = $true
}
else {
Write-Verbose "$User is not a member of the domain admins group"
$domainadmin = $false
}
[pscustomobject]@{
User = $user
DomainAdmin = $domainadmin
}
}
}
}