<< Back to Script Library

Manage this machine in Windows Admin Center

Opens Windows Admin Center to the server manager for the selected machine
Version: 1.2.11
Created: 2020-09-11
Modified: 2020-09-12
Creator: Trentent Tye
Downloads: 35
Tags: admn center windows
The Script Copy Script Copied to clipboard
        Opens the selected server in Windows Admin Center.

        Opens the selected server in Windows Admin Center.

    .PARAMETER  <WAC <string>>
        FQDN of your Windows Admin Center server
    .PARAMETER  <ComputerName <string>>
        Name of the server to open in WAC

    .PARAMETER  <Workstation <string>>
        True for a workstation/desktop OS or False for a Server OS

        . .\OpenWithWAC.ps1 -WAC WAC.bottheory.local -ComputerName HYPPVS2019-001 -Workstation $false
        Opens Windows Admin Center with a focus on the server HYPPVS2019-001

        A HTML5 compatible browser must be your default.  IE11 is not supported with WAC.


        Created TTYE : 2020-09-11

    AUTHOR: Trentent Tye

Param (
    [Parameter(Mandatory=$true,HelpMessage='Enter the FQDN of the Windows Admin Center Gateway or WAC server')][ValidateNotNullOrEmpty()] [string]$WAC,
    [Parameter(Mandatory=$true,HelpMessage='Enter the SamAccountName of the Server')][ValidateNotNullOrEmpty()]                           [string]$ComputerName,
    [Parameter(Mandatory=$true,HelpMessage='Workstation OS or Server OS')][ValidateNotNullOrEmpty()]                                      [string]$Workstation

if ($Workstation -like "True") {
    $DesktopOS = $true
} else {
    $DesktopOS = $false

$objSearcher = New-Object System.DirectoryServices.DirectorySearcher
$objSearcher.SearchRoot = New-Object System.DirectoryServices.DirectoryEntry
$objSearcher.Filter = "(&(objectCategory=Computer)(SamAccountname=$($ComputerName)`$))"
$objSearcher.SearchScope = "Subtree"
$ComputerObj = $objSearcher.FindOne()
$dnsHostName = $ComputerObj.Properties.dnshostname

if ($DesktopOS) {
   Start-Process "https://$WAC/computerManagement/connections/computer/$dnsHostName/tools/overview"
} else {
   Start-Process "https://$WAC/servermanager/connections/server/$dnsHostName/tools/overview"