Forums on Intune, SCCM, and Windows 11

Welcome to the forums. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your topics and posts, as well as connect with other members through your own private inbox!

PENDING Collection based on machines using KMS server

regbnn

New Member
Messages
2
Reaction score
0
Points
1
I need help creating a collection that pulls in machines that is using the KMS server to pull licenses.
 
This is little tricky. What you can try is using the event viewer to determine the KMS servers used by client and then create a collection.

Code:
$events = Get-WinEvent -computername KMS01 -LogName "Key Management Service" -FilterXPath "*[System[(EventID=12288 or EventID=12289 or EventID=12290)]]" -MaxEvents 10

$Results = foreach ($SingleEvent in $events){
    $xml = [xml]$SingleEvent.ToXml()
    [PSCustomObject]@{
        EventID     = $SingleEvent.Id
        ClientName  = $xml.Event.EventData.Data[3]
        TimeCreated = $SingleEvent.TimeCreated
        Message     = $SingleEvent.Message
    }
}
$Results
 
This is little tricky. What you can try is using the event viewer to determine the KMS servers used by client and then create a collection.

Code:
$events = Get-WinEvent -computername KMS01 -LogName "Key Management Service" -FilterXPath "*[System[(EventID=12288 or EventID=12289 or EventID=12290)]]" -MaxEvents 10

$Results = foreach ($SingleEvent in $events){
    $xml = [xml]$SingleEvent.ToXml()
    [PSCustomObject]@{
        EventID     = $SingleEvent.Id
        ClientName  = $xml.Event.EventData.Data[3]
        TimeCreated = $SingleEvent.TimeCreated
        Message     = $SingleEvent.Message
    }
}
$Results
I know the Kms server name that is getting used I just need to know how to create a collection that shows the machines pointing to that server. What I am trying to do is find the machines that is pointing to that server and determine if they should stay pulling their license from it or do I need to run a script that points it to the onboard license in the machine.
 
I know the Kms server name that is getting used I just need to know how to create a collection that shows the machines pointing to that server. What I am trying to do is find the machines that is pointing to that server and determine if they should stay pulling their license from it or do I need to run a script that points it to the onboard license in the machine.
You will need to inventory the KSM details first. once you do that you can create a collections based on the results.
 

Forum statistics

Threads
7,170
Messages
27,984
Members
18,286
Latest member
SteveL

Trending content

Back
Top