27 lines
932 B
PowerShell
Executable File
27 lines
932 B
PowerShell
Executable File
# Add and import AD PowerShell
|
|
Add-WindowsFeature RSAT-AD-PowerShell
|
|
Import-Module ActiveDirectory
|
|
|
|
# Host name of Windows Admin Center
|
|
$wac = "WinSrvr2019-01"
|
|
|
|
# Server names and Cluster names that you want to manage with Windows Admin Center in your domain
|
|
$servers = "HyperVHost-01", "HyperVHost-02", "HyperVHost-03", "HyperVHost-04", "ADServer-01", "ADServer-02", "VeeamServer", "WinSrvr2019-01", "WinSrvr2019-02", "WinSrvr2019-03", "WinSrvr2004-01", "GamingPC", "LaptopPC", "MediaPC", "Win1020H2-01"
|
|
|
|
# Get the identity object of WAC
|
|
$wacobject = Get-ADComputer -Identity $WAC
|
|
|
|
# Set the resource-based kerberos constrained delegation for each node
|
|
foreach ($server in $servers)
|
|
{
|
|
$serverObject = Get-ADComputer -Identity $server
|
|
Set-ADComputer -Identity $serverObject -PrincipalsAllowedToDelegateToAccount $wacobject
|
|
}
|
|
|
|
pause
|
|
|
|
# Clear KDC Cache
|
|
Invoke-Command -ComputerName $Servers -ScriptBlock {
|
|
klist purge -li 0x3e7
|
|
}
|