Posted On April 22, 2022

How To Install VMM Agent (SCVMM) Manually

kimconnect 0 comments
blog.KimConnect.com >> Virtualization >> How To Install VMM Agent (SCVMM) Manually

The following snippet assumes that a New Hyper-V Server has been added to the cluster; yet, it’s SCVMMAgent Service doesn’t get installed or is corrupted such as:

PS C:\Windows\system32> get-service SCVMMAgent
get-service : Cannot find any service with service name 'SCVMMAgent'.
At line:1 char:1
+ get-service SCVMMAgent
+ ~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (SCVMMAgent:String) [Get-Service], ServiceCommandException
    + FullyQualifiedErrorId : NoServiceFoundForGivenName,Microsoft.PowerShell.Commands.GetServiceCommand
# Version 0.01
# No robot crawler to locate the highest VMMAgent version automatically (will code that when I feel like it)

# Install VMM Agent
$vmmServer='vmmServerName'
$version='10.19.2591.0'
$agentMsiFile="\\$vmmServer\C$\Program Files\Microsoft System Center\Virtual Machine Manager\agents\amd64\$version\vmmAgent.msi"

# Installing VMM Agent using its MSI File
$file=gi $agentMsiFile
$DataStamp = get-date -Format yyyyMMddTHHmmss
$logFile ="C:\" + '{0}-{1}.log' -f $file.name,$DataStamp
$MSIArguments = @(
    "/i"
    ('"{0}"' -f $file.fullname)
    "/qn"
    "/norestart"
    "/L*v"
    $logFile
)
Start-Process "msiexec.exe" -ArgumentList $MSIArguments -Wait -NoNewWindow

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

Upgrade Virtual Hardware Version in VMM

The following script will upgrade all guest virtual machines from a lower version to the…

AWS Autoscale with Public IP re-association

Option 1:--associate-public-ip-address command option with the as-create-launch-config commandOption 2:Allocate an Elastic IP then adding a…

PowerShell: Obtain List of Hyper-V Hosts via Active Directory

# listHyperVHostsInForests.ps1 # Version: 0.03 function listHyperVHostsInForests{ # Ensure that AD management module is available…